Comparing version 0.0.3 to 0.0.4
20
index.js
@@ -98,10 +98,7 @@ // The MIT License | ||
if ('object' === typeof options.params) { | ||
if (this.params) { | ||
mixin(options.params, this.params); | ||
} | ||
options.path += '?' + querystring.stringify(options.params); | ||
} else { | ||
options.path += '?' + options.params; | ||
if (this.params) { | ||
mixin(options.params, this.params); | ||
} | ||
options.path += '?' + querystring.stringify(options.params); | ||
} | ||
@@ -112,6 +109,5 @@ | ||
if ('json' === options.type) { | ||
options.headers['Content-Type'] = 'application/json'; | ||
options.body = JSON.stringify(options.body); | ||
} else { | ||
options.headers['Content-Type'] = 'application/x-www-form-urlencoded'; | ||
options.type = 'form'; | ||
options.body = querystring.stringify(options.body); | ||
@@ -123,2 +119,8 @@ } | ||
options.headers['Content-Length'] = Buffer.byteLength(options.body); | ||
if ('json' === options.type) { | ||
options.headers['Content-Type'] = 'application/json'; | ||
} else if ('form' === options.type) { | ||
options.headers['Content-Type'] = 'application/x-www-form-urlencoded'; | ||
} | ||
} else if ('DELETE' === method || | ||
@@ -125,0 +127,0 @@ 'PUT' === method || |
{ | ||
"name": "nest", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A Node HTTP client aimed at REST API's.", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
23212
14
593