Changeset 12630
- Timestamp:
- 02/22/08 16:56:27 (11 months ago)
- Files:
-
- 1 modified
-
dojo/trunk/_base/xhr.js (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dojo/trunk/_base/xhr.js
r12291 r12630 255 255 256 256 /*===== 257 dojo.__ioArgs = function(kwArgs){ 257 dojo.__IoArgs = function( url, content, timeout, form, 258 preventCache, handleAs, load, error, handle){ 258 259 // url: String 259 260 // URL to server endpoint. … … 278 279 // load: Function? 279 280 // function(response, ioArgs){}. response is an Object, ioArgs 280 // is of type dojo.__ ioCallbackArgs. The load function will be281 // is of type dojo.__IoCallbackArgs. The load function will be 281 282 // called on a successful response. 282 283 // error: Function? 283 284 // function(response, ioArgs){}. response is an Object, ioArgs 284 // is of type dojo.__ ioCallbackArgs. The error function will285 // is of type dojo.__IoCallbackArgs. The error function will 285 286 // be called in an error case. 286 // handle: Function 287 // handle: Function? 287 288 // function(response, ioArgs){}. response is an Object, ioArgs 288 // is of type dojo.__ ioCallbackArgs. The handle function will289 // is of type dojo.__IoCallbackArgs. The handle function will 289 290 // be called in either the successful or error case. For 290 291 // the load, error and handle functions, the ioArgs object 291 292 // will contain the following properties: 293 this.url = url; 294 this.content = content; 295 this.timeout = timeout; 296 this.form = form; 297 this.preventCache = preventCache; 298 this.handleAs = handleAs; 299 this.load = load; 300 this.error = error; 301 this.handle = handle; 292 302 } 293 303 =====*/ 294 304 295 305 /*===== 296 dojo.__ ioCallbackArgs = function(kwArgs){306 dojo.__IoCallbackArgs = function(args, xhr, url, query, handleAs, id, canDelete, json){ 297 307 // args: Object 298 308 // the original object argument to the IO call. … … 328 338 // the same object should be passed to the success 329 339 // callbacks directly. 340 this.args = args; 341 this.xhr = xhr; 342 this.url = url; 343 this.query = query; 344 this.handleAs = handleAs; 345 this.id = id; 346 this.canDelete = canDelete; 347 this.json = json; 330 348 } 331 349 =====*/ … … 333 351 334 352 335 dojo._ioSetArgs = function(/*dojo.__ ioArgs*/args,353 dojo._ioSetArgs = function(/*dojo.__IoArgs*/args, 336 354 /*Function*/canceller, 337 355 /*Function*/okHandler, … … 448 466 } 449 467 450 var _makeXhrDeferred = function(/*dojo.__ xhrArgs*/args){468 var _makeXhrDeferred = function(/*dojo.__XhrArgs*/args){ 451 469 //summary: makes the Deferred object for this xhr request. 452 470 var dfd = _d._ioSetArgs(args, _deferredCancel, _deferredOk, _deferError); … … 596 614 } 597 615 598 dojo._ioAddQueryToUrl = function(/*dojo.__ ioCallbackArgs*/ioArgs){616 dojo._ioAddQueryToUrl = function(/*dojo.__IoCallbackArgs*/ioArgs){ 599 617 //summary: Adds query params discovered by the io deferred construction to the URL. 600 618 //Only use this for operations which are fundamentally GET-type operations. … … 606 624 607 625 /*===== 608 dojo. __xhrArgs = function(kwArgs){609 // summary:610 // In addition to the properties listed for the dojo.__ioArgs type,611 // the following properties are allowed for dojo.xhr* methods.612 // handleAs:613 // String. Acceptable values are:614 // "text" (default)615 // "json"616 // "json-comment-optional"617 // "json-comment-filtered"618 // "javascript"619 // "xml"620 // sync:621 // Boolean. false is default. Indicates whether the request should622 // be a synchronous (blocking) request.623 // headers:624 // Object. Additional HTTP headers to send in the request.625 } 626 dojo.declare("dojo.__XhrArgs", dojo.__IoArgs, { 627 constructor: function(handleAs, sync, headers){ 628 // summary: 629 // In addition to the properties listed for the dojo._IoArgs type, 630 // the following properties are allowed for dojo.xhr* methods. 631 // handleAs: String? 632 // Acceptable values are: text (default), json, json-comment-optional, 633 // json-comment-filtered, javascript, xml 634 // sync: Boolean? 635 // false is default. Indicates whether the request should 636 // be a synchronous (blocking) request. 637 // headers: Object? 638 // Additional HTTP headers to send in the request. 639 this.handleAs = handleAs; 640 this.sync = sync; 641 this.headers = headers; 642 } 643 }); 626 644 =====*/ 627 645 628 dojo.xhr = function(/*String*/ method, /*dojo.__ xhrArgs*/ args, /*boolean?*/ hasBody){646 dojo.xhr = function(/*String*/ method, /*dojo.__XhrArgs*/ args, /*boolean?*/ hasBody){ 629 647 // summary: 630 648 // Sends an HTTP request with the given method. If the request has an … … 640 658 } 641 659 642 dojo.xhrGet = function(/*dojo.__ xhrArgs*/ args){660 dojo.xhrGet = function(/*dojo.__XhrArgs*/ args){ 643 661 // summary: 644 662 // Sends an HTTP GET request to the server. … … 646 664 } 647 665 648 dojo.xhrPost = function(/*dojo.__ xhrArgs*/ args){666 dojo.xhrPost = function(/*dojo.__XhrArgs*/ args){ 649 667 //summary: 650 668 // Sends an HTTP POST request to the server. … … 652 670 } 653 671 654 dojo.rawXhrPost = function(/*dojo.__ xhrArgs*/ args){672 dojo.rawXhrPost = function(/*dojo.__XhrArgs*/ args){ 655 673 // summary: 656 674 // Sends an HTTP POST request to the server. In addtion to the properties 657 // listed for the dojo.__ xhrArgs type, the following property is allowed:675 // listed for the dojo.__XhrArgs type, the following property is allowed: 658 676 // postData: 659 677 // String. The raw data to send in the body of the POST request. … … 663 681 } 664 682 665 dojo.xhrPut = function(/*dojo.__ xhrArgs*/ args){683 dojo.xhrPut = function(/*dojo.__XhrArgs*/ args){ 666 684 // summary: 667 685 // Sends an HTTP PUT request to the server. … … 669 687 } 670 688 671 dojo.rawXhrPut = function(/*dojo.__ xhrArgs*/ args){689 dojo.rawXhrPut = function(/*dojo.__XhrArgs*/ args){ 672 690 // summary: 673 691 // Sends an HTTP PUT request to the server. In addtion to the properties 674 // listed for the dojo.__ xhrArgs type, the following property is allowed:692 // listed for the dojo.__XhrArgs type, the following property is allowed: 675 693 // putData: 676 694 // String. The raw data to send in the body of the PUT request. … … 684 702 } 685 703 686 dojo.xhrDelete = function(/*dojo.__ xhrArgs*/ args){704 dojo.xhrDelete = function(/*dojo.__XhrArgs*/ args){ 687 705 // summary: 688 706 // Sends an HTTP DELETE request to the server.