Reputation: 13
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?
Upvotes: 0
Views: 582
Reputation: 136910
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.
Upvotes: 1