request-component
superagent client only version.
Last updated 4 years ago by chemzqm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install request-component 
SYNC missed versions from official npm registry.

Request

visionmedia/superagent client only version.

doc

Installation

Install with component(1):

$ 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

Current Tags

  • 0.0.4                                ...           latest (4 years ago)

4 Versions

  • 0.0.4                                ...           4 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 9
Last Day 0
Last Week 4
Last Month 5
Dependencies (2)
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |