我想知道导致以下错误的原因是数据发送到的网站还是脚本问题?
我发送了以下POST请求:
import requests
session = requests.session()
url = "private url"
headers = {"Content-Type": "Application/json"}
session.headers.update(headers)
payload = {"test": "test", "quantity": 1}
output = session.post(url, data=payload)
print(output.text)
输出:
{"_v":"14.6","fault":{"type":"InvalidMessageException","message":"An error occurred while decoding the request, the body was 'test=test&quantity=1'."}