-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
How can I capture 302? #1806
Comments
You can use the following code: http
.get('http://example.com/')
// following redirects
.redirects(0)
// error handling
.ok(res => res.status >= 200 && res.status < 400)
.then(res => {
console.log(res.status)
console.log(res.headers['location'])
}) Reference documentation: |
thx, I'll try later |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I request an API, this API will return 302, and automatically jump to another API, and then return data, but I see status code has been 200, I need to capture 302 to do some operations, what should I do?
thanks
The text was updated successfully, but these errors were encountered: