aqax
Minimal, promise based XMLHttpRequest wrapper
var promise = ; promise; promise;
API
Send
var promise = ;
Shortcuts
var promise = ; var promise = ; var promise = ; var promise = ;
Options
Name | Type | Description | Default |
---|---|---|---|
headers | object | map of request headers | |
query | string/object | query string, objects are serialized | |
data | string/object | data to send, objects are serialized based on the type |
|
type | string | type provides hints for auto setting headers and serialzing data. Available values are form , json , xml , html , text |
none |
cache | boolean | add timestamp to query string for cache busting if false | true |
timeout | number | client request timeout | 0 |
encoding | string | specify an encoding that is appended to auto set Content-type request header | none |
autoHeaders | boolean | If true, auto sets the Content-type and Accepts headers based upon the type unless they have already been set |
true |
Build
Build with browserify:
browserify ./src/aqax.js --standalone aqax > ./dist/aqax-with-q.js