Possible was meant "options" instead of "data"?

This commit is contained in:
nkuznetsov
2014-10-07 12:45:47 +06:00
parent d004995792
commit 063fd80bed

View File

@@ -14,8 +14,8 @@ module.exports = function (url, options, cb) {
'content-type': 'application/x-www-form-urlencoded',
'content-length': Buffer.byteLength(data)
};
} else if (data.json) {
data = JSON.stringify(data.json);
} else if (options.json) {
data = JSON.stringify(options.json);
options.headers = {
'content-type': 'application/json',
'content-length': Buffer.byteLength(data)