Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python GAE urlfetch credentials

I'd like to know if the Google App Engine URL Fetch Python API does not support accessing URLs that have credentials:

http://username:[email protected]/

It should be a basic feature, but I cannot get it to work and could not find any documentation about it being supported or not as well.

like image 465
raugfer Avatar asked Dec 04 '11 17:12

raugfer


1 Answers

SOLUTION - here's how it should be done:

result = urlfetch.fetch("http://www.domain.com/",
                        headers={"Authorization": 
                                 "Basic %s" % base64.b64encode("username:password")})
like image 72
raugfer Avatar answered Oct 20 '22 19:10

raugfer