Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api problem in http module #7272

Closed
kimown opened this issue Jun 11, 2016 · 3 comments
Closed

api problem in http module #7272

kimown opened this issue Jun 11, 2016 · 3 comments
Labels
doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem.

Comments

@kimown
Copy link
Contributor

kimown commented Jun 11, 2016

https://nodejs.org/dist/latest-v4.x/docs/api/http.html#http_http_request_options_callback
In this section, the demo use

postData.length

as the value of the Content-Length,I think should use

Buffer.byteLength(postData)

insead.
I use the code in the example frequently,so I think the code should be more widely used.

@Trott
Copy link
Member

Trott commented Jun 11, 2016

Would you be willing to file a pull request? The text to update is in https://github.com/nodejs/node/blob/master/doc/api/http.md

@mscdex mscdex added http Issues or PRs related to the http subsystem. doc Issues and PRs related to the documentations. labels Jun 11, 2016
@kimown
Copy link
Contributor Author

kimown commented Jun 12, 2016

Thanks for reminding me.

@Trott #7274

@cjihrig
Copy link
Contributor

cjihrig commented Jun 13, 2016

Closing, as this landed in d06820c.

@cjihrig cjihrig closed this as completed Jun 13, 2016
cjihrig referenced this issue Jun 13, 2016
As the description in http.md:

> If the body contains higher coded characters then
Buffer.byteLength() should be used to determine the number of
bytes in a given encoding.

PR-URL: #7274
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jackson Tian <shyvo1987@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

No branches or pull requests

4 participants