diff --git a/doc/api/http.md b/doc/api/http.md index aba2d7e4041c8b..b06886f09d2738 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -809,7 +809,7 @@ Example: ```js var body = 'hello world'; response.writeHead(200, { - 'Content-Length': body.length, + 'Content-Length': Buffer.byteLength(body), 'Content-Type': 'text/plain' }); ``` @@ -1119,7 +1119,7 @@ var options = { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - 'Content-Length': postData.length + 'Content-Length': Buffer.byteLength(postData) } };