In Chrome network tab, I can find requests. I want to replicate one request in python.
Here is the URL-encoded version, and it works when I pass it to requests.post
res = requests.post("https://www.cmskchp.com/sailingsJson", headers=headers, data=formdata)
Chrome also provides a parsed version of Form data 
I tried to pass a python dict to requests.post but always get internal server error.
I have tried both data and json parameters or requests.post.
Also tried encoding using json.dumps, urllib.parse.urlencode, urllib.parse.quote_plus, none of them worked for me.
Can someone show me the correct way to encode python dict into raw form data?
When I right click the request and copy the javascript fetch code of the request the form data is already encoded. How does Chrome encode/decode it?

Aucun commentaire:
Enregistrer un commentaire