W3cubDocs

/Dojo

dojo/_base/kernel.__XhrArgs

Summary

In addition to the properties listed for the dojo._IoArgs type, the following properties are allowed for dojo.xhr* methods.

Note: This is not a real constructor, but just a description of the type of object that should be passed as a parameter to some method(s), and/or the return value from some method(s). In other words, the type exists only for documentation purposes, and you cannot call new kernel.__XhrArgs()

Properties

content

Defined by: dojo/_base/xhr

Contains properties with string values. These properties will be serialized as name1=value2 and passed in the request.

contentType

Defined by: dojo/_base/xhr

"application/x-www-form-urlencoded" is default. Set to false to prevent a Content-Type header from being sent, or to a string to send a different Content-Type.

failOk

Defined by: dojo/_base/xhr

false is default. Indicates whether a request should be allowed to fail (and therefore no console error message in the event of a failure)

form

Defined by: dojo/_base/xhr

DOM node for a form. Used to extract the form values and send to the server.

handleAs

Defined by: dojo/_base/xhr

Acceptable values are: text (default), json, json-comment-optional, json-comment-filtered, javascript, xml. See dojo/_base/xhr.contentHandlers

headers

Defined by: dojo/_base/xhr

Additional HTTP headers to send in the request.

ioPublish

Defined by: dojo/_base/xhr

Set this explicitly to false to prevent publishing of topics related to IO operations. Otherwise, if djConfig.ioPublish is set to true, topics will be published via dojo/topic.publish() for different phases of an IO operation. See dojo/main.__IoPublish for a list of topics that are published.

preventCache

Defined by: dojo/_base/xhr

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.

rawBody

Defined by: dojo/_base/xhr

Sets the raw body for an HTTP request. If this is used, then the content property is ignored. This is mostly useful for HTTP methods that have a body to their requests, like PUT or POST. This property can be used instead of postData and putData for dojo/_base/xhr.rawXhrPost and dojo/_base/xhr.rawXhrPut respectively.

sync

Defined by: dojo/_base/xhr

false is default. Indicates whether the request should be a synchronous (blocking) request.

timeout

Defined by: dojo/_base/xhr

Milliseconds to wait for the response. If this time passes, the then error callbacks are called.

url

Defined by: dojo/_base/xhr

URL to server endpoint.

Methods

error(response,ioArgs)

Defined by dojo/_base/xhr

This function will be called when the request fails due to a network or server error, the url is invalid, etc. It will also be called if the load or handle callback throws an exception, unless djConfig.debugAtAllCosts is true. This allows deployed applications to continue to run even when a logic error happens in the callback, while making it easier to troubleshoot while in debug mode.

Parameter Type Description
response Object

The response in the format as defined with handleAs.

ioArgs dojo/main.__IoCallbackArgs

Provides additional information about the request.

handle(loadOrError,response,ioArgs)

Defined by dojo/_base/xhr

This function will be called at the end of every request, whether or not an error occurs.

Parameter Type Description
loadOrError String

Provides a string that tells you whether this function was called because of success (load) or failure (error).

response Object

The response in the format as defined with handleAs.

ioArgs dojo/main.__IoCallbackArgs

Provides additional information about the request.

load(response,ioArgs)

Defined by dojo/_base/xhr

This function will be called on a successful HTTP response code.

Parameter Type Description
response Object

The response in the format as defined with handleAs.

ioArgs dojo/main.__IoCallbackArgs

Provides additional information about the request.

© 2005–2017 JS Foundation
Licensed under the AFL 2.1 and BSD 3-Clause licenses.
http://dojotoolkit.org/api/1.10/dojo/_base/kernel.__XhrArgs.html