Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

httpreq

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

httpreq - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

19

httpreq.js

@@ -38,3 +38,7 @@ /*

moreOptions.method = 'GET';
this.doRequest(moreOptions, callback);
if(moreOptions.allowRedirects === undefined)
moreOptions.allowRedirects = true;
doRequest(moreOptions, callback);
}

@@ -50,6 +54,6 @@

moreOptions.method = 'POST';
this.doRequest(moreOptions, callback);
doRequest(moreOptions, callback);
}
exports.doRequest = function(o, callback){
function doRequest(o, callback){
var chunks = [];

@@ -116,2 +120,9 @@ var body;

ended = true;
// check for redirects
if(res.headers.location && o.allowRedirects){
o.url = res.headers.location;
return doRequest(o, callback);
}
var responsebody = Buffer.concat(chunks);

@@ -251,2 +262,2 @@ if(!o.binary)

exports.doRequest = doRequest;
{
"name": "httpreq",
"description": "node-httpreq is a node.js library to do HTTP(S) requests the easy way",
"version": "0.2.4",
"version": "0.2.5",
"author": {

@@ -6,0 +6,0 @@ "name": "Sam Decrock",

@@ -35,2 +35,3 @@ node-httpreq

- body: custom body content you want to send
- allowRedirects: (default: __true__ ...only with httpreq.get ), if true, redirects will be followed
- callback(err, res): A callback function which is called when the request is complete. __res__ contains the headers ( __res.headers__ ), the http status code ( __res.statusCode__ ) and the body ( __res.body__ )

@@ -90,2 +91,3 @@

- body: custom body content you want to send. Parameters are ignored when this is used.
- allowRedirects: (default: false), if true, redirects will be followed
- callback(err, res): A callback function which is called when the request is complete. __res__ contains the headers ( __res.headers__ ), the http status code ( __res.statusCode__ ) and the body ( __res.body__ )

@@ -186,2 +188,3 @@

- body: custom body content you want to send
- allowRedirects: (default: false), if true, redirects will be followed
- callback(err, res): A callback function which is called when the request is complete. __res__ contains the headers ( __res.headers__ ), the http status code ( __res.statusCode__ ) and the body ( __res.body__ )

@@ -188,0 +191,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc