The OpenLayers.Request namespace contains convenience methods for working with XMLHttpRequests. These methods work with a cross-browser W3C compliant OpenLayers.Request.XMLHttpRequest class.
OpenLayers. Request | The OpenLayers.Request namespace contains convenience methods for working with XMLHttpRequests. |
Constants | |
DEFAULT_CONFIG | {Object} Default configuration for all requests. |
Functions | |
issue | Create a new XMLHttpRequest object, open it, set any headers, bind a callback to done state, and send any data. |
GET | Send an HTTP GET request. |
POST | Send a POST request. |
PUT | Send an HTTP PUT request. |
DELETE | Send an HTTP DELETE request. |
HEAD | Send an HTTP HEAD request. |
OPTIONS | Send an HTTP OPTIONS request. |
issue: function( config )
Create a new XMLHttpRequest object, open it, set any headers, bind a callback to done state, and send any data.
config | {Object} Object containing properties for configuring the request. Allowed configuration properties are described below. This object is modified and should not be reused. |
method | {String} One of GET, POST, PUT, DELETE, HEAD, or OPTIONS. Default is GET. |
url | {String} URL for the request. |
async | {Boolean} Open an asynchronous request. Default is true. |
user | {String} User for relevant authentication scheme. Set to null to clear current user. |
password | {String} Password for relevant authentication scheme. Set to null to clear current password. |
proxy | {String} Optional proxy. Defaults to <OpenLayers.ProxyHost>. |
params | {Object} Any key:value pairs to be appended to the url as a query string. Assumes url doesn’t already include a query string or hash. Parameter values that are arrays will be concatenated with a comma (note that this goes against form-encoding) as is done with <OpenLayers.Util.getParameterString>. |
headers | {Object} Object with header:value pairs to be set on the request. |
data | {Object} Any data to send with the request. |
callback | {Function} Function to call when request is done. To determine if the request failed, check request.status (200 indicates success). |
success | {Function} Optional function to call if request status is in the 200s. This will be called in addition to callback above and would typically only be used as an alternative. |
failure | {Function} Optional function to call if request status is not in the 200s. This will be called in addition to callback above and would typically only be used as an alternative. |
scope | {Object} If callback is a public method on some object, set the scope to that object. |
{XMLHttpRequest} Request object. To abort the request before a response is received, call abort() on the request object.
GET: function( config )
Send an HTTP GET request. Additional configuration properties are documented in the issue method, with the method property set to GET.
config | {Object} Object with properties for configuring the request. See the issue method for documentation of allowed properties. This object is modified and should not be reused. |
{XMLHttpRequest} Request object.
POST: function( config )
Send a POST request. Additional configuration properties are documented in the issue method, with the method property set to POST and “Content-Type” header set to “application/xml”.
config | {Object} Object with properties for configuring the request. See the issue method for documentation of allowed properties. The default “Content-Type” header will be set to “application-xml” if none is provided. This object is modified and should not be reused. |
{XMLHttpRequest} Request object.
PUT: function( config )
Send an HTTP PUT request. Additional configuration properties are documented in the issue method, with the method property set to PUT and “Content-Type” header set to “application/xml”.
config | {Object} Object with properties for configuring the request. See the issue method for documentation of allowed properties. The default “Content-Type” header will be set to “application-xml” if none is provided. This object is modified and should not be reused. |
{XMLHttpRequest} Request object.
DELETE: function( config )
Send an HTTP DELETE request. Additional configuration properties are documented in the issue method, with the method property set to DELETE.
config | {Object} Object with properties for configuring the request. See the issue method for documentation of allowed properties. This object is modified and should not be reused. |
{XMLHttpRequest} Request object.
HEAD: function( config )
Send an HTTP HEAD request. Additional configuration properties are documented in the issue method, with the method property set to HEAD.
config | {Object} Object with properties for configuring the request. See the issue method for documentation of allowed properties. This object is modified and should not be reused. |
{XMLHttpRequest} Request object.
OPTIONS: function( config )
Send an HTTP OPTIONS request. Additional configuration properties are documented in the issue method, with the method property set to OPTIONS.
config | {Object} Object with properties for configuring the request. See the issue method for documentation of allowed properties. This object is modified and should not be reused. |
{XMLHttpRequest} Request object.
Create a new XMLHttpRequest object, open it, set any headers, bind a callback to done state, and send any data.
issue: function( config )
Send an HTTP GET request.
GET: function( config )
Send a POST request.
POST: function( config )
Send an HTTP PUT request.
PUT: function( config )
Send an HTTP DELETE request.
DELETE: function( config )
Send an HTTP HEAD request.
HEAD: function( config )
Send an HTTP OPTIONS request.
OPTIONS: function( config )