我用python请求。我试图发送一个post请求,需要发送数组的数组。这是我的代码:
import requests
def connecttomlapipost(url, vector):
headers = {'content-type': 'application/json'}
r= requests.post(url, verify=False, auth=('admin', 'admin'), data = vector, headers=headers)
return r
print connecttomlapipost('https://......', [[2,3],[1,5]])
服务器返回:错误500。我使用POSTMAN测试,服务器返回正确的结果
您正在使用}感兴趣。它应该是字典结构而不是列表。See the docs.
post
,并且很可能对使用data
或{相关问题 更多 >
编程相关推荐