-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
doc: nodejs > http > get > Example KO #37907
Copy link
Copy link
Closed
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.
Type
Fields
Give feedbackNo fields configured for issues without a type.
📗 API Reference Docs Problem
Location
Section of the site where the content exists
Affected URL(s):
Description
Concise explanation of the problem
Provided example doesn't work anymore, returns an error "Request failed. Status code: 301."
The provided url leads to http :
http.get('http://nodejs.org/dist/index.json', (res) => {but said resource get automatically redirected to it's https twin.
In the example, anything other than 200 is thrown away
if (statusCode !== 200)You need to set a new resource in http only (no redirection towards https) as the http module can't handle the https protocol ^^.
Cheers
submit a pull request.