Axa a low level Ajax/Xhr library.
npm install axanpm install axa --savedist/axa.jssrc/axa.b.m.js##### Options
- action: String Resource action url/uri. Required
- method: String Valid methods get, post, put, delete. Default: GET
- success: Function
- error: Function
- data: Object If method is GET than data is serialized and concatenated to the action/url as parameters.
- requestType: String Converts the request data before sending.
- script 'text/javascript, application/javascript, application/x-javascript'
- json 'application/json' stringifies options.data
- xml 'application/xml, text/xml'
- html 'text/html'
- text 'text/plain'
- Default 'application/x-www-form-urlencoded' serializes options.data
- responseType: String Converts the response data after sending a request.
- script 'text/javascript, application/javascript, application/x-javascript'
- json 'application/json'
- xml 'application/xml, text/xml'
- html 'text/html'
- text 'text/plain'
- contentType: String Short hand to set the Content-Type Headers. (For request)
- accept: String Short hand to set the Accept Headers. (For response)
- mimeType: String Overwrites return type.
- username: String
- password: String
- withCredentials: Boolean
- headers: Object A low level headers object. This will map directly to the XMLHttpRequest header. This Will overwrite any previously defined options.
##### Example
``JavaScript`
Axa.request({
method: 'get',
action: '/examples/index.html',
data: { name: 'stuff' },
success: function (xhr) {
console.log(xhr);
},
error: function (xhr) {
console.log(xhr);
}
});
##### Parameter
- Object Single level deep key value pare
##### Example
`JavaScript`
var stringData = Axa.serialize(data);
##### Return
- Object a object containing the mimes.
##### Example
`JavaScript``
var mime = Axa.mime;