【发布时间】:2010-08-26 16:11:06
【问题描述】:
我尝试使用 AppEngine 中的 urlfetch 将 POST 数据发送到服务器。其中一些 POST 数据项具有相同的名称,但具有不同的值。
form_fields = {
"data": "foo",
"data": "bar"
}
form_data = urllib.urlencode(form_fields)
result = urlfetch.fetch(url="http://www.foo.com/", payload=form_data, method=urlfetch.POST, headers={'Content-Type': 'application/x-www-form-urlencoded'})
然而,在这个例子中,服务器似乎只接收到一个名为data 的项目,其值为bar。我该如何解决这个问题?
【问题讨论】:
标签: python google-app-engine urlfetch