request-sync
Because sometimes you want your web requests to be synchronous
Last updated 13 years ago by forbeslindesay .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install request-sync 
SYNC missed versions from official npm registry.

request-sync is deprecated, use sync-request

request-sync

Because sometimes you want your web requests to be synchronous

Build Status Dependency Status NPM version

Installation

npm install request-sync

Usage

Make a web request:

Options:

  • uri || url - fully qualified uri or parsed url object from url.parse()
  • method - http method (default: "GET")
  • qs - object containing querystring values to be appended to the uri
  • headers - http headers (default: {})
  • body - entity body for PATCH, POST and PUT requests. Must be a Buffer or String.
  • auth - A hash containing values user || username, password || pass
  • encoding - encoding to stringify the result body, set this to null to get a Buffer
var response = request('http://www.example.com');
// => {statusCode: 200, headers: {}, body: 'string of html'}

var response = request('http://www.example.com', {method: 'GET'});
// => {statusCode: 200, headers: {}, body: 'string of html'}

var response = request({method: 'GET', uri: 'http://www.example.com'});
// => {statusCode: 200, headers: {}, body: 'string of html'}

License

MIT

Current Tags

  • 1.0.0                                ...           latest (12 years ago)

8 Versions

  • 1.0.0 [deprecated]           ...           12 years ago
  • 0.0.7                                ...           12 years ago
  • 0.0.6                                ...           12 years ago
  • 0.0.5                                ...           13 years ago
  • 0.0.4                                ...           13 years ago
  • 0.0.3                                ...           13 years ago
  • 0.0.2                                ...           13 years ago
  • 0.0.1                                ...           13 years ago
Maintainers (1)
Downloads
Total 16
Today 0
This Week 0
This Month 9
Last Day 0
Last Week 4
Last Month 0
Dependencies (3)
Dev Dependencies (4)
Dependents (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE