dev_appengine.py
升级到最新的 SDK 1.9.17 后,当我在本地运行我的项目时开始出现此错误
INFO 2014-12-10 09:48:33,364 myapp.py:796] Url: http://saas.examples.com/documents, payload: {'filename': u'testlink.doc', 'key': u'p1UuXhzhS4qjj2KXmFre'}
WARNING 2014-12-10 09:48:34,089 urlfetch_stub.py:451] Received a 301 to a POST. Redirecting with a GET
WARNING 2014-12-10 09:48:34,791 myapp.py:809] failed. Code: 405, error: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>
我的代码非常简单。
result = urlfetch.fetch(
url=url,
payload=json.dumps(payload),
method=urlfetch.POST,
headers={'Content-Type': 'application/json'})
if result.status_code == utils.OK:
json_result = json.loads(result.content)
else:
logging.warn(
'failed. Code: %s, error: %s',
result.status_code, result.content)
恢复到以前版本的 SDK (1.9.15) 后,异常再次消失。
我的问题:
1)这是一个GAE错误吗?如果是这样,向 GAE 团队报告的正确方法是什么?
2) 如果不是 GAE SDK 问题,我该如何修复我的代码?