0.2.13 • Published 8 years ago
tinyget v0.2.13
tinyget
A tiny http client for nodejs & browser
Installation
$ npm install tinyget --saveOr, via webmodules
$ wpm install tinyget --saveOr, via bower
$ bower install tinyget --saveUsage
Node.js (commonjs)
var tinyget = require('tinyget');Browser (global)
var tinyget = window.TinyGet;Example
// default is get
tinyget('/path/file').qry({key: value}).exec(function(err, result) {
// TODO
});
// get, post, put, delete, options
tinyget.post('/path/file').payload({key:'value'}).exec(function(err, result) {
// TODO
});
// alt style 1
tinyget({
url: '/path/file',
payload: {key:'value'}
}).exec(function(err, result) {
// TODO
});
tinyget.post({
url: '/path/file',
contentType: 'application/json',
evalType: 'json',
payload: {key:'value'}
}).exec(function(err, result) {
// TODO
});
// alt style 2
tinyget({
url: '/path/file',
payload: {key:'value'}
}, function(err, result) {
// TODO
});
tinyget.put({
url: '/path/file',
payload: {key:'value'}
}, function(err, result) {
// TODO
});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/jsonelsetext/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.
0.2.13
8 years ago
0.2.12
8 years ago
0.2.11
8 years ago
0.2.10
8 years ago
0.2.9
9 years ago
0.2.8
9 years ago
0.2.7
9 years ago
0.2.6
9 years ago
0.2.5
9 years ago
0.2.4
9 years ago
0.2.3
9 years ago
0.2.2
9 years ago
0.2.1
9 years ago
0.2.0
9 years ago
0.1.12
9 years ago
0.1.11
9 years ago
0.1.10
9 years ago
0.1.9
9 years ago
0.1.8
9 years ago
0.1.7
9 years ago
0.1.6
9 years ago
0.1.5
9 years ago
0.1.4
9 years ago
0.1.3
9 years ago
0.1.2
9 years ago
0.1.1
9 years ago
0.1.0
9 years ago
0.0.11
10 years ago
0.0.10
10 years ago
0.0.9
10 years ago
0.0.8
10 years ago
0.0.7
10 years ago
0.0.6
10 years ago
0.0.5
10 years ago
0.0.4
10 years ago
0.0.3
10 years ago
0.0.2
10 years ago
0.0.1
10 years ago
0.0.0
10 years ago