【发布时间】:2014-03-24 15:00:49
【问题描述】:
我正在开发一个使用 API 的应用程序,该 API 要求我发出第一个 Post 请求以进行身份验证。
查看身份验证响应,我看到创建了一个 cookie:ApiCredentials=....
所以我验证了:
result = urlfetch.fetch(url = url, method = urlfetch.POST)
api_credential = result.headers['set-cookie']
然后我在标头中使用该 cookie 创建一个请求
urlfetch.fetch(url = url, method = urlfetch.GET, headers = {'Cookie': api_credential})
问题是:在开发中一切正常,但是当我部署时,它不起作用。在日志中我可以看到收到的 cookie。
API 链接:http://www.sptrans.com.br/desenvolvedores/APIOlhoVivo/Documentacao.aspx?1(葡萄牙语)
【问题讨论】:
标签: python google-app-engine cookies