Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
324 views
in Technique[技术] by (71.8m points)

python requests on Google App Engine not working for HTTPS

I'm using python-request on Google App Engine and it's not working as expected for HTTPS. Let's see an example:

import requests
requests.get('https://www.digitalocean.com')

That line works perfectly if I execute it in a terminal. Response is 200 OK (without redirects).

However, if I execute it on GAE a TooManyRedirects error is raised. Trying to figure out what's the problem I execute with allow_redirects=False and I can see that the response is a redirect (301) which points to the same url!!! ('location' header value is 'https://www.digitalocean.com'). This obviously (when allow_redirect=True) happens over and over again until the TooManyRedirects error is raised.

So it seems that python-requests is not working on GAE for HTTPS (I've tested with several URL). However HTTP works perfectly.

Any idea about what's happening?

Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...