Class Index | File Index

Classes


Namespace orion.xhr

Provides a promise-based API to XMLHttpRequest.
Defined in: </shared/eclipse/e4/orion/I201402262325/plugins/org.eclipse.orion.client.core/web/orion/xhr.js>.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<static>  
orion.xhr.xhr(method, url, options)
Wrapper for XMLHttpRequest that returns a promise.
Namespace Detail
orion.xhr
Method Detail
<static> {Deferred} orion.xhr.xhr(method, url, options)
Wrapper for XMLHttpRequest that returns a promise.
Parameters:
{String} method
One of 'GET', 'POST', 'PUT', 'DELETE'.
{String} url
The URL to request.
{Object} options Optional
{Object|ArrayBuffer|Blob|Document} options.data Optional
The raw data to send as the request body. (Only allowed for POST and PUT).
{Object} options.headers Optional
A map of header names and values to set on the request.
{Boolean} options.log Optional, Default: false
If true, failed requests will be logged to the JavaScript console.
{String} options.responseType Optional, Default: ''
Determines the type of the response object returned. Value must be one of the following:
  • 'arraybuffer'
  • 'blob'
  • 'document'
  • 'json'
  • 'text'
  • '' (same as 'text')
{Number} options.timeout Optional, Default: 0
Timeout in milliseconds. Defaults to 0 (no timeout).
Returns:
{Deferred} A deferred for the result. The deferred will resolve on 2xx, 3xx status codes or reject on 4xx, 5xx status codes. In both cases a orion.xhr.Result is provided to the listener.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Feb 26 2014 23:28:27 GMT-0500 (EST)