dojo.xhr
<script src="../../js/dojo.js"></script>
defined in dojo/_base/xhr.js
Sends an HTTP request with the given method. If the request has an HTTP body, then pass true for hasBody. The method argument should be uppercase. Also look at dojo.xhrGet(), xhrPost(), xhrPut() and dojo.xhrDelete() for shortcuts for those HTTP methods. There are also methods for "raw" PUT and POST methods via dojo.rawXhrPut() and dojo.rawXhrPost() respectively.
parameter | type | description |
---|
method | String | |
args | dojo.__XhrArgs | In addition to the properties listed for the dojo._IoArgs type, the following properties are allowed for dojo.xhr* methods.field | type | description |
---|
.content | Object | Optional. Contains properties with string values. These properties will be serialized as name1=value2 and passed in the request. | .error | Function | Optional. function(response, ioArgs){}. response is an Object, ioArgs is of type dojo.__IoCallbackArgs. The error function will be called in an error case. | .form | DOMNode | Optional. DOM node for a form. Used to extract the form values and send to the server. | .handle | Function | Optional. function(response, ioArgs){}. response is an Object, ioArgs is of type dojo.__IoCallbackArgs. The handle function will be called in either the successful or error case. For the load, error and handle functions, the ioArgs object will contain the following properties: | .handleAs | String | Optional. Acceptable values are: text (default), json, json-comment-optional, json-comment-filtered, javascript, xml | .headers | Object | Optional. Additional HTTP headers to send in the request. | .load | Function | Optional. function(response, ioArgs){}. response is an Object, ioArgs is of type dojo.__IoCallbackArgs. The load function will be called on a successful response. | .preventCache | Boolean | Optional. Default is false. If true, then a "dojo.preventCache" parameter is sent in the request with a value that changes with each request (timestamp). Useful only with GET-type requests. | .sync | Boolean | Optional. false is default. Indicates whether the request should be a synchronous (blocking) request. | .timeout | Integer | Optional. Milliseconds to wait for the response. If this time passes, the then error callbacks are called. | .url | String | URL to server endpoint. |
|
hasBody | Boolean | Optional. |