0

我想知道如何在 GAE 请求中将数组作为 REST 参数传递。我的具体意图是获得一系列整数。

4

1 回答 1

1

您可以使用 json 转储数组并将 json 字符串添加到帖子的有效负载中。

例子:

list_1 = [1,2,3,4,5]
list_2 = ['A', 'B', 'C']
data = {'list_1' : list_1, 'list_2' : list_22}
response = urlfetch.fetch(url='http://....', payload=simplejson.dumps(data), method=urlfetch.POST,
                          headers={'Content-Type': 'application/x-www-form-urlencoded'})
于 2012-10-11T16:00:10.713 回答