Python GAE urlfetch凭证 [英] Python GAE urlfetch credentials

查看:106
本文介绍了Python GAE urlfetch凭证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道Google App Engine 网址抓取Python API 是否不支持访问具有凭据的URL:

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.

推荐答案

result = urlfetch.fetch("http://www.domain.com/",
                        headers={"Authorization": 
                                 "Basic %s" % base64.b64encode("username:password")})

这篇关于Python GAE urlfetch凭证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆