I want to write an auto downloader in Node.js using the http.get method from a GitHub release using the API and and i receive 302 error. What can i do?
Asked
Active
Viewed 471 times
1 Answers
1
HTTP 302 isn't an error:
The HTTP response status code 302 Found is a common way of performing URL redirection.
You can handle HTTP 302 Found by retrieving the URL shown in the Location response header.
Instead of using http.get, you might want to consider using the request library as suggested in this answer. request should automatically follow the redirect.
Community
- 1
- 1
ChrisGPT was on strike
- 127,765
- 105
- 273
- 257
-
Thanks for the answer – loopByte Jun 09 '15 at 08:54
-
I am new to stackoverflow and i didn't knew i have to do this. – loopByte Jun 10 '15 at 13:19