Comparing version 0.4.3 to 0.4.4
@@ -158,3 +158,3 @@ ////////////////////////////////////////// | ||
content_type: mime.type, | ||
text: mime.type.indexOf('text/') != -1, | ||
text: mime.type && mime.type.indexOf('text/') != -1, | ||
charset: mime.charset | ||
@@ -161,0 +161,0 @@ } |
{ | ||
"name": "needle" | ||
, "version": "0.4.3" | ||
, "version": "0.4.4" | ||
, "description": "Tiny yet feature-packed HTTP client. With multipart, charset decoding and proxy support." | ||
@@ -5,0 +5,0 @@ , "keywords": ["http", "https", "simple", "client", "multipart", "upload", "proxy", "deflate", "timeout", "charset", "iconv"] |
@@ -41,2 +41,3 @@ Needle | ||
- `parse`: Whether to parse XML or JSON response bodies automagically. Defaults to `true`. | ||
- `output`: Dump response output to file. When response is text, this occurs after parsing/decoding is done. | ||
@@ -120,2 +121,10 @@ Note: To stay light on dependencies, Needle doesn't include the `xml2js` module used for XML parsing. To enable it, simply do `npm install xml2js`. | ||
### GET binary, output to file | ||
``` js | ||
needle.get('http://upload.server.com/tux.png', { output: '/tmp/tux.png' }, function(err, resp, body){ | ||
// you can dump any response to a file, not only binaries. | ||
}); | ||
``` | ||
### GET through proxy | ||
@@ -122,0 +131,0 @@ |
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
45928
218
0
5
5
12
398