0

我正在尝试使用 action=insertDestinationOrder 插入目标订单 我正在使用带有所有必需参数的 POST 方法,但不断获取

{
    "errorCode": 40,
    "errorMsg": "general error"
}

我也使用邮递员检查过。但还是一样。

下面是使用 python requests 包的请求。

import requests

url = "https://csv.telematics.tomtom.com/extern"

payload = "orderid=TO0049&country=DE&city=Cologne&latitude=50974519&ordertype=delivery%20order&zip=50735&longitude=6977319&street=Am%20Niehler%20Hafen%20%26%20Stapelkai%2C%2050735%20Cologne%20(Niehl)&account=XXXX&username=XXXX&password=XXXX&apikey=XXXX&lang=en&action=insertDestinationOrder&ordertext=Am%20Niehler%20Hafen%20%26%20Stapelkai%2C%2050735%20Cologne%20(Niehl)&useUTF8=true&outputformat=json"
headers = {
    'content-type': "application/x-www-form-urlencoded"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)

需要一些帮助。

4

1 回答 1

0

尝试将 a 添加?到 url 的末尾有效负载的开头:

url = "https://csv.telematics.tomtom.com/extern?"

或者

payload = "?orderid=TO0049&country=DE&city=Cologne&latitude=50974519&ordertype=delivery%20order&zip=50735&longitude=6977319&street=Am%20Niehler%20Hafen%20%26%20Stapelkai%2C%2050735%20Cologne%20(Niehl)&account=XXXX&username=XXXX&password=XXXX&apikey=XXXX&lang=en&action=insertDestinationOrder&ordertext=Am%20Niehler%20Hafen%20%26%20Stapelkai%2C%2050735%20Cologne%20(Niehl)&useUTF8=true&outputformat=json"
于 2018-08-13T12:33:30.157 回答