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

doc: sending http request to localhost to avoid https redirect #38036

Closed
wants to merge 3 commits into from

Conversation

hassaanp
Copy link
Contributor

@hassaanp hassaanp commented Apr 2, 2021

In the JSON fetching example, http.get request is being sent to an http url that redirects to https. This causes the http.get request to fail. To avoid redirect errors, a local http server is set up that returns a json response.

Fixes: #37907

In the JSON fetching example, http.get request is being sent to an http url that redirects to https. This causes the http.get request to fail. To avoid redirect errors, a local http server is set up that returns a json response.

Fixes: nodejs#37907
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem. labels Apr 2, 2021
doc/api/http.md Outdated Show resolved Hide resolved
Co-authored-by: Antoine du Hamel <[email protected]>
@hassaanp
Copy link
Contributor Author

hassaanp commented Apr 2, 2021

@aduh95 thank you for the suggestions. I have gone with the JSON.stringify approach.

doc/api/http.md Outdated Show resolved Hide resolved
Co-authored-by: Antoine du Hamel <[email protected]>
@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 2, 2021
jasnell pushed a commit that referenced this pull request Apr 6, 2021
In the JSON fetching example, http.get request is being sent to
an http url that redirects to https. This causes the http.get
request to fail. To avoid redirect errors, a local http server
is set up that returns a json response.

Fixes: #37907

PR-URL: #38036
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Nitzan Uziely <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell
Copy link
Member

jasnell commented Apr 6, 2021

Landed in 0d34767

@jasnell jasnell closed this Apr 6, 2021
targos pushed a commit that referenced this pull request May 1, 2021
In the JSON fetching example, http.get request is being sent to
an http url that redirects to https. This causes the http.get
request to fail. To avoid redirect errors, a local http server
is set up that returns a json response.

Fixes: #37907

PR-URL: #38036
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Nitzan Uziely <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@danielleadams danielleadams mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

doc: nodejs > http > get > Example KO
8 participants