Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chemzqm/request
Send request with fluent API in modern browser
https://github.com/chemzqm/request
Last synced: 10 days ago
JSON representation
Send request with fluent API in modern browser
- Host: GitHub
- URL: https://github.com/chemzqm/request
- Owner: chemzqm
- Created: 2014-06-13T20:52:36.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-05T08:13:43.000Z (over 8 years ago)
- Last Synced: 2024-10-29T12:41:53.383Z (about 2 months ago)
- Language: JavaScript
- Size: 217 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Request
[visionmedia/superagent](https://github.com/visionmedia/superagent) client only version.
[doc](http://visionmedia.github.io/superagent/)
## Installation
Install with [component(1)](http://component.io):
$ component install chemzqm/request
## API
### .get(url, [data, callback])
### .put(url, [data, callback])
### .del(url, [data, callback])
### .post(url, [data, callback])
### .head(url, [data, callback])Perform http request `get|put|delete|post|post|head` with url.
### .query(str | obj)
Add query string to url, could be called multiply times.
### .set('str')
### .set(object)Set header/heaers to the request, could be called multiply times.
### .send(str | obj)
### .end(err, res)
Error is not null if either network error or response status code is not ok.
`res.text` is response text, `res.body` is available used if response type is `json`
err.message would be `res.body.message` if it's exist.
`res.header` is the object contains response headers.
## License
MIT