【发布时间】:2016-03-04 15:40:07
【问题描述】:
我发现使用 httplib2 文档中定义的以下模板的 httplib2 样本非常少。
以下(GET)工作(我现在需要使用它实现 POST 方法)
URLS = (
'/', 'PingLocal',
'/ping', 'PingLocal',
'/ping/silo', 'PingSilo'
)
class PingLocal(object):
def GET(self):
return json.dumps({'time': time.strftime('%m/%d/%Y %I:%M:%S'), 'message': 'XYZ Server Responding to Ping'})
如何实现 POST 方法并将数据(正文)传递给 post 请求? 我确实遇到的几个例子不使用这个建议
“URLS 列表/类” 模型。
任何指针表示赞赏。谢谢。
【问题讨论】:
标签: python-2.7 rest post httplib2