Python GAE urlfetch credentials

前端 未结 1 1317
礼貌的吻别
礼貌的吻别 2020-12-31 07:31

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.co         


        
相关标签:
1条回答
  • 2020-12-31 07:57

    SOLUTION - here's how it should be done:

    result = urlfetch.fetch("http://www.domain.com/",
                            headers={"Authorization": 
                                     "Basic %s" % base64.b64encode("username:password")})
    
    0 讨论(0)
提交回复
热议问题