简体   繁体   中英

Python 3 requests POST request data/params issue

The issue is that the data/parameters in the POST request aren't being sent correctly to be processed by the server . I've used Burp to check what's wrong and it seems like the parameters are in the request's body as they should, but the thing is that when I go to the params tab they don't show there, they're supposed to show there as body parameters , not URL nor cookie ones

Everything else works fine, if I edit the request and add them manually it works just fine. Although I would rather have the request headers being sent in the right order, but that's another question, I tried to use an OrderedDict to accomplish that but didn't work

Lastly, one of the parameters has a "+" in its value, it gets encoded like a URL would, in the original request that doesn't happen, so that needs fixing too

Any help would be appreciated, I've been trying for a while

Way of calling requests.post:

requests.Session().post(url=url, timeout=timeout, data=payloads, headers=headers, verify="C:\\OpenSSL-Win64\\bin\\certificate.pem")

Finally figured it out, it was the Content-Type, didn't change it when I copied the code for my first request that I edited, silly mistake, but it was hard to spot

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM