Login Register Help
API Documentation
Choose a stylesheet:

Functiondojo.xhrPost (returns dojo.Deferred)

dojo.require("dojo._base.xhr");
Sends an HTTP POST request to the server. In addtion to the properties listed for the dojo.__XhrArgs type, the following property is allowed: postData: String. Send raw data in the body of the POST request.
parametertypedescription
argsdojo.__XhrArgsIn addition to the properties listed for the dojo._IoArgs type, the following properties are allowed for dojo.xhr* methods.
fieldtypedescription
contentObjectContains properties with string values. These properties will be serialized as name1=value2 and passed in the request.
errorFunctionThis 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.
failOkBooleanfalse is default. Indicates whether a request should be allowed to fail (and therefore no console error message in the event of a failure)
formDOMNodeDOM node for a form. Used to extract the form values and send to the server.
handleFunctionThis function will be called at the end of every request, whether or not an error occurs.
handleAsStringAcceptable values are: text (default), json, json-comment-optional, json-comment-filtered, javascript, xml. See dojo.contentHandlers
headersObjectAdditional HTTP headers to send in the request.
ioPublishBooleanSet 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.publish for different phases of an IO operation. See dojo.__IoPublish for a list of topics that are published.
loadFunctionThis function will be called on a successful HTTP response code.
preventCacheBooleanDefault 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.
syncBooleanfalse is default. Indicates whether the request should be a synchronous (blocking) request.
timeoutIntegerMilliseconds to wait for the response. If this time passes, the then error callbacks are called.
urlStringURL to server endpoint.

Usage

var foo: dojo.Deferred=dojo.xhrPost(args: dojo.__XhrArgs);