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?
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
Can this be closed?
Most helpful comment
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