curlrequest
Advanced tools
Comparing version 0.3.10 to 0.4.0
12
index.js
@@ -155,9 +155,7 @@ var util = require('util') | ||
} | ||
if (options.encoding) { | ||
encoding = options.encoding; | ||
if (encoding === 'ascii') { | ||
options['use-ascii'] = true; | ||
} | ||
delete options.encoding; | ||
encoding = options.encoding; | ||
if (encoding === 'ascii') { | ||
options['use-ascii'] = true; | ||
} | ||
delete options.encoding; | ||
@@ -392,3 +390,3 @@ //Parse POST data | ||
if (typeof obj[i] === 'object') { | ||
copy[i] = exports.copy(obj[i]); | ||
copy[i] = copy[i] ? exports.copy(obj[i]) : null; | ||
} else { | ||
@@ -395,0 +393,0 @@ copy[i] = obj[i]; |
{ "name" : "curlrequest", | ||
"description" : "A curl wrapper for node", | ||
"version" : "0.3.10", | ||
"version" : "0.4.0", | ||
"homepage" : "https://github.com/chriso/curlrequest", | ||
@@ -5,0 +5,0 @@ "author" : "Chris O'Hara <cohara87@gmail.com>", |
17
test.js
var curl = require('./'); | ||
curl.request({ url: 'http://google.com', pretend: true }, function (err, stdout, meta) { | ||
console.log('%s %s', meta.cmd, '"' + meta.args.join('" "') + '"'); | ||
}); | ||
var options = { | ||
url: 'http://node.io' | ||
, encoding: null | ||
}; | ||
(function next() { | ||
curl.request(options, function (err, data, meta) { | ||
console.log(meta.args); | ||
console.log(data); | ||
console.log(data.toString()); | ||
console.log(typeof data); | ||
//next(); | ||
}); | ||
})(); |
27493
496