How can I make post requests with querystrings using sessions in Python?

Viewed 28

i'm using requests module and i'm interested in sending a post request with querystrings using sessions, how can I do that? I haven't found anything related with request.Sessions and querystrings

with Sessions (it returns me a http 500 response code)

response = self.session.post(self.url, data = payload, headers = self.headers, params = querystring)

without Sessions ( it works fine)

response = requests.request("POST", self.url, json=payload, headers=self.headers, params=querystring)
1 Answers

Maybe you can provide the url and a little bit more code.

In the session example you pass data=payload. In the second example json=payload.

Did you create the session correctly?

Related