문제

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

http://username:password@www.domain.com/

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.

도움이 되었습니까?

해결책

SOLUTION - here's how it should be done:

result = urlfetch.fetch("http://www.domain.com/",
                        headers={"Authorization": 
                                 "Basic %s" % base64.b64encode("username:password")})
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top