# Jaxer.XHR.SendOptions : Object
Return to: Jaxer Framework index

Options used to define the behavior of Jaxer.XHR.send.

## Platform Support

Jaxer Server Framework | Jaxer Client Framework
--- | ---
1.0 | 1.0

## Constructors

Constructor | Action | Jaxer Server Framework | Jaxer Client Framework
--- | --- | --- | ---
Jaxer.XHR.SendOptions Constructor() : Jaxer.XHR.SendOptions Options used to define the behavior of Jaxer.XHR.send. Create a new Jaxer.XHR.SendOptions() to get the default options, then modify its properties as needed before passing it to Jaxer.XHR.send. | Show Details | 1.0 | 1.0

### Jaxer.XHR.SendOptions() : Jaxer.XHR.SendOptions

Options used to define the behavior of Jaxer.XHR.send. Create a new Jaxer.XHR.SendOptions() to get the default options, then modify its properties as needed before passing it to Jaxer.XHR.send.

Returns

Jaxer.XHR.SendOptions | Returns an instance of SendOptions.

## Properties

Property | Action | Jaxer Server Framework | Jaxer Client Framework
--- | --- | --- | ---
pollingPeriod : Number For async requests, the number of milliseconds between polling for onreadystatechange, by default 11 (Advanced) | No Details | 1.0 | 1.0

Visibility
  advanced

as : String Set to "text" to force interpreting the response as text regardless of mimetype. Set to "xml" to force interpreting the response as XML regardless of mimetype and returning the XML as an XML (DOM) object via XMLHttpRequest.responseXML. Set to null to not force anything - see overrideMimeType and responseType for finer control. | No Details | 1.0 | 1.0

async : Boolean Set to true for asynchronous, false for synchronous. By default it's true client-side and false server-side. To use it server-side, see also Jaxer.Thread.waitFor. | Show Details | 1.0 | 1.0

See Also

  Jaxer.Thread.waitFor

cacheBuster : Boolean If true (default, client-side), a random name and value query pair will be appended to the URL on each call | No Details | 1.0 | 1.0

contentType : String The content type of the request being sent (by default "application/x-www-form-urlencoded") | No Details | 1.0 | 1.0

getTransport : Function The function to use to create the XMLHttpRequest, by default XHR.getTransport | No Details | 1.0 | 1.0

headers : Array Set to null to use default headers; set to an array of [ name, value ] arrays to use custom headers instead | No Details | 1.0 | 1.0

method : String Should be "GET" (default, server-side) or "POST" (default, client-side) | No Details | 1.0 | 1.0

onfailure : Function Set to a custom callback function to call if unsuccessful (by default set to Jaxer.XHR.onfailure client-side). Its arguments are the error encountered, the "extra" information from the caller, and the XHR instance. | No Details | 1.0 | 1.0

onfinished : Function Set to a custom function to call when done receiving (or timed out), usually to abort() | No Details | 1.0 | 1.0

onreadytosend : Function Set to a custom function to call just before sending (e.g. to set custom headers, mimetype, keep reference to xhr object, etc.) | No Details | 1.0 | 1.0

onsuccess : Function Set to a function to call if successful. Its arguments are the response received back from the server, and any "extra" information passed in when calling send(). For synchronous calls, you can optionally set onsuccess to null to have XHR.send() return a value directly (and throw errors on failure/timeout). | No Details | 1.0 | 1.0

ontimeout : Function Set to a custom timeout function to call if timeout is used and the async request has timed out. Its arguments are the timeout error encountered, the "extra" information from the caller, and the XHR instance. | No Details | 1.0 | 1.0

overrideMimeType : String Set to null to use whatever mimetype the server sends in the response; set to a mimetype string (e.g. "text/plain") to force the response to be interpreted using the given mimetype | No Details | 1.0 | 1.0

password : String If the target URL requires authentication, specify this password, otherwise leave this as null. | No Details | 1.0 | 1.0

responseText : String Set to "text" (default) to use the responseText, to "xml" to use the responseXML, or "auto" to use the response's content-type to choose | No Details | 1.0 | 1.0

testSuccess : Function Set to a custom function that receives the XMLHttpRequest (after readyState == 4) and tests whether it succeeded (by default Jaxer.XHR.testSuccess) | No Details | 1.0 | 1.0

timeout : Number For async (client-side) requests, set to number of milliseconds before timing out, or 0 to wait indefinitely | Show Details | 1.0 | 1.0

See Also

  Jaxer.XHR.defaults.timeout|Jaxer.XHR.SendOptions.DEFAULT_TIMEOUT

url : String The URL to which the XMLHttpRequest is to be sent. On the client side, defaults to Jaxer.CALLBACK_URI which is used to handle function callbacks from client-side proxies to their server-side counterparts. | No Details | 1.0 | 1.0

username : String If the target URL requires authentication, specify this username, otherwise leave this as null. | No Details | 1.0 | 1.0

static extendedResponse : Boolean If this is set to true, the response returned directly or passed to an onsuccess handler will contain detailed information about the response, in the form of a Jaxer.XHR.ResponseData object. | Show Details | 1.0 | 1.0

See Also

  Jaxer.XHR.ResponseData

aptana_docs