我一直在尝试向typeform发送POST请求,但是我一直得到以下输出:
{"code":"INVALID_PAYLOAD"}
我尝试了以下操作,但未能成功完成请求。标头的使用没有不同的结果。
我如何正确格式化有效载荷?
import requests
import time
epochTime = int(time.time())
token = requests.get("https://typeformtutorial.typeform.com/app/form/result/token/aA7Vx9/default")
data = {
"signature": token,"form_id": "aA7Vx9","landed_at": epochTime,"answers": [
{
"field": {
"id": "42758279","type": "yes_no"
},"type": "boolean","boolean": True
},{
"field": {
"id": "42758410","type": "short_text"
},"type": "text","text": "Hi"
}
]
}
r = requests.post("https://typeformtutorial.typeform.com/app/form/submit/aA7Vx9",data=data)
print(r.text) #.... INVALID_PAYLOAD