Deprecated. Use dojo/request instead.
Sends an HTTP request with the given method. See also 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 | HTTP method to be used, such as GET, POST, PUT, DELETE. Should be uppercase. |
args | Object | |
hasBody | Boolean |
Optional If the request has an HTTP body, then pass true for hasBody. |
See the dojo/_base/xhr reference documentation for more information.
A map of available XHR transport handle types. Name matches the
handleAs
attribute passed to XHR calls.
Adds query params discovered by the io deferred construction to the URL. Only use this for operations which are fundamentally GET-type operations.
Parameter | Type | Description |
---|---|---|
ioArgs | Object | An object with the following properties:
|
Cancels all pending IO requests, regardless of IO type (xhr, script, iframe).
If dojo.publish is available, publish topics about the start of a request queue and/or the the beginning of request.
Used by IO transports. An IO transport should call this method before making the network connection.
Parameter | Type | Description |
---|---|---|
dfd | dojo/_base/Deferred |
sets up the Deferred and ioArgs property on the Deferred so it can be used in an io call.
Parameter | Type | Description |
---|---|---|
args | dojo/main.__IoArgs | The args object passed into the public io call. Recognized properties on the args object are: |
canceller | Function | The canceller function used for the Deferred object. The function will receive one argument, the Deferred object that is related to the canceller. |
okHandler | Function | The first OK callback to be registered with Deferred. It has the opportunity to transform the OK response. It will receive one argument -- the Deferred object returned from this function. |
errHandler | Function | The first error callback to be registered with Deferred. It has the opportunity to do cleanup on an error. It will receive two arguments: error (the Error object) and dfd, the Deferred object returned from this function. |
Watches the io request represented by dfd to see if it completes.
Parameter | Type | Description |
---|---|---|
dfd | dojo/_base/Deferred | The Deferred object to watch. |
validCheck | Function | Function used to check if the IO request is still valid. Gets the dfd object as its only argument. |
ioCheck | Function | Function used to check if basic IO call worked. Gets the dfd object as its only argument. |
resHandle | Function | Function used to process response. Gets the dfd object as its only argument. |
Sends an HTTP DELETE request to the server.
Parameter | Type | Description |
---|---|---|
args | Object | An object with the following properties:
|
Serialize a form field to a JavaScript object.
Returns the value encoded in a form field as as a string or an array of strings. Disabled form elements and unchecked radio and checkboxes are skipped. Multi-select elements are returned as an array of string values.
Parameter | Type | Description |
---|---|---|
inputNode | DOMNode | String |
Create a serialized JSON string from a form node or string ID identifying the form to serialize
Parameter | Type | Description |
---|---|---|
formNode | DOMNode | String | |
prettyPrint | Boolean |
Optional
|
Serialize a form node to a JavaScript object.
Returns the values encoded in an HTML form as string properties in an object which it then returns. Disabled form elements, buttons, and other non-value form elements are skipped. Multi-select elements are returned as an array of string values.
Parameter | Type | Description |
---|---|---|
formNode | DOMNode | String |
This form:
<form id="test_form"> <input type="text" name="blah" value="blah"> <input type="text" name="no_value" value="blah" disabled> <input type="button" name="no_value2" value="blah"> <select type="select" multiple name="multi" size="5"> <option value="blah">blah</option> <option value="thud" selected>thud</option> <option value="thonk" selected>thonk</option> </select> </form>
yields this object structure as the result of a call to formToObject():
{ blah: "blah", multi: [ "thud", "thonk" ] };
Returns a URL-encoded string representing the form passed as either a node or string ID identifying the form to serialize
Parameter | Type | Description |
---|---|---|
formNode | DOMNode | String |
Sends an HTTP GET request to the server.
Parameter | Type | Description |
---|---|---|
args | Object | An object with the following properties:
|
takes a name/value mapping object and returns a string representing a URL-encoded version of that object.
Parameter | Type | Description |
---|---|---|
map | Object |
this object:
{ blah: "blah", multi: [ "thud", "thonk" ] };
yields the following query string:
"blah=blah&multi=thud&multi=thonk"
Sends an HTTP POST request to the server. In addition to the properties listed for the dojo.__XhrArgs type, the following property is allowed:
Parameter | Type | Description |
---|---|---|
args | Object | An object with the following properties:
|
Sends an HTTP PUT request to the server. In addition to the properties listed for the dojo.__XhrArgs type, the following property is allowed:
Parameter | Type | Description |
---|---|---|
args | Object | An object with the following properties:
|
Create an object representing a de-serialized query section of a URL. Query keys with multiple values are returned in an array.
Parameter | Type | Description |
---|---|---|
str | String |
This string:
"foo=bar&foo=baz&thinger=%20spaces%20=blah&zonk=blarg&"
results in this object structure:
{ foo: [ "bar", "baz" ], thinger: " spaces =blah", zonk: "blarg" }
Note that spaces and other urlencoded entities are correctly handled.