tinyget
A tiny http client for nodejs & browser
Installation
$ npm install tinyget --save
Or, via webmodules
$ wpm install tinyget --save
Or, via bower
$ bower install tinyget --save
Usage
Node.js (commonjs)
var tinyget = ;
Browser (global)
var tinyget = windowTinyGet;
Example
// default is get; // get, post, put, delete, optionstinyget; // alt style 1; tinyget; // alt style 2; tinyget;
Options
- options : url string or object
- url: remote url(string), required.
- payload: payload (string/object), default is null.
- qry: query string (string/object), default is null.
- contentType: request content-type (string), default when payload is object
application/json
elsetext/form-url-encoded
- responseType: xhr.responseType(xhr2) (string), default is null
- type: response object eval type
text, json, xml
(string), default isauto
- headers: request headers (object), default is null.
- sync: sync request (boolean), default is false
License
Licensed under the MIT License. See LICENSE for the full license text.