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

Better description of statuscode handling and improve example #29714

Closed
DanielRuf opened this issue Sep 26, 2019 · 2 comments
Closed

Better description of statuscode handling and improve example #29714

DanielRuf opened this issue Sep 26, 2019 · 2 comments
Labels
doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem.

Comments

@DanielRuf
Copy link

Currently https://nodejs.org/api/http.html#http_http_get_url_options_callback mentions only 200 but any 2xx statuscode is a success and not an error.

This should be improved.

If you have a question, suggestion or issue regarding our website,
please post it in https://github.com/nodejs/nodejs.org!

Issues with the Node.js API documentation should be posted here. All other
issues regarding the website will be closed.

@szhigunov
Copy link

Hi, I can handle that.

szhigunov added a commit to szhigunov/node that referenced this issue Dec 11, 2019
Clearly describe that any 2xx statusCode indicates success response

Fixes: nodejs#29714
@Trott
Copy link
Member

Trott commented Dec 17, 2019

@DanielRuf What do you think the code should check for instead? A previous contributor's attempt to make the status code check more lenient resulted in this comment:

I think the original is better. If that endpoint is expected to return 200 it is better to be strict. Also 201 is not usually used for a GET request, 204 has no content, etc.

@Trott Trott added doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem. labels Dec 17, 2019
jasnell added a commit to jasnell/node that referenced this issue Jul 6, 2020
@jasnell jasnell closed this as completed in a720c0e Jul 9, 2020
MylesBorins pushed a commit that referenced this issue Jul 14, 2020
Fixes: #29714

PR-URL: #34223
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
MylesBorins pushed a commit that referenced this issue Jul 16, 2020
Fixes: #29714

PR-URL: #34223
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
addaleax pushed a commit that referenced this issue Sep 22, 2020
Fixes: #29714

PR-URL: #34223
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
addaleax pushed a commit that referenced this issue Sep 22, 2020
Fixes: #29714

PR-URL: #34223
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@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
3 participants