Skip to content

marcelerz/request-sync

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

This is deprecated now, use sync-request instead.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%