Comparing version 0.2.0 to 0.2.1
{ | ||
"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"); | ||
}); | ||
} | ||
}); | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74989
224