Skip to content
Discussion options

You must be logged in to vote

I've found this snippet to work out what redirection is happening:

if response.history:
    print("Request was redirected")
    for resp in response.history:
        print(resp.status_code, resp.url)
    print("Final destination:")
    print(response.status_code, response.url)
else:
    print("Request was not redirected")

And the output was:

Request was redirected
301 http://192.168.1.101/production.json
Final destination:
200 https://192.168.1.101/production.json

So I fixed my script to point to https!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by frazzmatazz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant