Very simple problem. When I go to my Web site in any browser, it redirects. When I do a requests.get(my_url)
on the exact same URL and protocol, I get a 200 response. Why? It doesn't matter if I set allow_redirects to True or False, I still get the same behavior. I tried setting a header so requests pretends to be Firefox, I still get the same behavior.
How can I get requests.get to give me the redirect that a browser gets on the exact same URL?
#!/usr/bin/env/python
import requests
result = requests.get("https://bgjkfgbjfgghbjdfbhdgfjkh.fake")
print(result.status_code)
The above prints "200".