Socket
Socket
Sign inDemoInstall

httpreq

Package Overview
Dependencies
0
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.2.1

2

package.json
{
"name": "httpreq",
"description": "node-httpreq is a node.js library to do HTTP(S) requests the easy way",
"version": "0.2.0",
"version": "0.2.1",
"author": {

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

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

* [httpreq.doRequest(options, callback)](#dorequest)
* [Downloading a binary file](#binary)

@@ -151,3 +152,3 @@ ---------------------------------------

url: "http://rekognition.com/demo/do_upload/",
options:{
parameters:{
name_space : 'something',

@@ -204,2 +205,22 @@ },

---------------------------------------
<a name="binary" />
### Downloading a binary file
To download a binary file, just add __binary: true__ to the options when doing a get or a post.
__Example__
```js
httpreq.get('https://ssl.gstatic.com/gb/images/k1_a31af7ac.png', {binary: true}, function (err, res){
if (err){
console.log(err);
}else{
fs.writeFile(__dirname + '/test.png', res.body, function (err) {
if(err)
console.log("error writing file");
});
}
});
```
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc