This is what I observed with f12 in chrome:
The payload here doesn't seem like json data since there is 89:42 in the front.
payload = ["auth",{"form":{"id":"xxxx","email":"xxx@xxx"}}]
resp = requests.post(url, json=payload, headers=headers)
print(resp.status_code)
payload = '89:42["auth",{"form":{"id":"xxxx","email":"xxx@xxx"}}]'
resp = requests.post(url, data=payload, headers=headers)
print(resp.status_code)
The status code of the above resp are both 400(bad request). How can I post it correctly?
[EDIT] I actually used Session
to maintain the session. I'v also tried to change the content-type to application/json
. But it didn't work. And as your can see in the picture, the default content-type seen with f12 is text/plain
.
[EDIT] Some said the data
or json
argument must be a dict
. Does it means that I should rewrite 89:42["auth",{"form":{"id":"xxxx","email":"xxx@xxx"}}]
to change its type to dict
? How should I do this?