Browse Source

Use buffer byte length at POST body

pull/44/head
ARASHI, Jumpei 10 years ago
parent
commit
01ead4bbd5
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lib/client.js

+ 1
- 1
lib/client.js View File

@ -80,7 +80,7 @@ client.prototype.request = function(method, path, params, callback){
if(["POST", "PUT"].indexOf(http_options["method"]) >= 0){ if(["POST", "PUT"].indexOf(http_options["method"]) >= 0){
http_options["headers"] = { http_options["headers"] = {
"Content-Type": params["contentType"] ? params["contentType"] : "application/json", "Content-Type": params["contentType"] ? params["contentType"] : "application/json",
"Content-Length": body.length,
"Content-Length": Buffer.byteLength(body),
}; };
} }


Loading…
Cancel
Save