Coffeekraken.io 0.0.1

SAjaxRequest

Class that represent an ajax request that will be passed to an SAjax instance

Example

    const request = new SAjaxRequest({
     url : '/api/...',
     method : 'GET',
     data : {
         myVar : 'myVal'
     }
});

Author : Olivier Bosselolivier.bossel@gmail.com

Constructor

Name Type Description Status Default
params { Object } The request params required

Properties

url

The url to call

Type : { String }

Default : null

method

The request method to use like GET, POST, DELETE or PUT

Type : { String }

Default : GET

cors

Use the CORS or not (only for IE)

Type : { Boolean }

Default : true

cache

Use the cache or not

Type : { Boolean }

Default : true

data

The data that will be sent with the request in JSON format

Type : { Object }

Default : null

dataType

The data type expected from the response Accepted dataType are : text | json | html

Type : { String }

Default : text

contentType

Set the content type header to send with the request

Type : { String }

Default : null

requestedWith

Set the X-Requested-With header

Type : { String }

Default : XMLHttpRequest

auth

Set the Authorization header

Type : { String }

Default : null

headers

Set additional headers to send with the request

Type : { Object }

Default : null