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

requests geting status_code is error #5055

Open
NeoZion opened this issue Apr 12, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@NeoZion
Copy link

commented Apr 12, 2019

use requests.get('https://test.xiubi.com').status_code report web status_code '200'.
use 'wget' and 'curl' report web status_code '302'.

why requests report error status_code?

@bolivierjr

This comment has been minimized.

Copy link

commented Apr 12, 2019

The site has a redirect header and "requests" will redirect automatically by default. If you use curl, you need to use the -L flag, then you'll get a 200 status code.
E.g. curl -L https://test.xiubi.com

@wyattfry

This comment has been minimized.

Copy link

commented Apr 14, 2019

Can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.