Synopsis
A thin Q wrapper around ded's reqwest AJAX library.
Install
Node
npm install q-reqwest
Browser
Get the latest minified release and download it to your project.
You can load the q-reqwest
module with an AMD or CommonJS module loader or use it via the reqwest
property of the Q
global with a script tag:
From Github
git clone https://github.com/pluma/q-reqwest.gitcd q-reqwestnpm installmake && make min
API
ajax(config:Object):Q
Passes the given config
object to reqwest
and returns a Q
promise that is resolved or rejected when the request terminates.
If config
is a string, it will be passed as the url
option. For a full list of options see the reqwest API documentation.
get(config:Object):Q
Shorthand for ajax({method: 'get'})
.
post(config:Object):Q
Shorthand for ajax({method: 'post'})
.
put(config:Object):Q
Shorthand for ajax({method: 'put'})
.
del(config:Object):Q
Shorthand for ajax({method: 'delete'})
.
patch(config:Object):Q
Shorthand for ajax({method: 'patch'})
.
defaults
Contains the default options that will be used by ajax
.
Unlicense
This is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.