S
S
sumi3sew2019-03-17 12:24:07
Python
sumi3sew, 2019-03-17 12:24:07

How to get cookie data for post request?

I want to send a post request to the site. This requires a csrf token and a few more variable variables. The problem is how to get these variables, which would then be inserted into the main post request. I tried this, but only 1 of the variables I need is displayed.

import requests

cl = requests.session()
cl.get('https://myurl')

print(cl.cookies.get_dict())

What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2019-03-17
@Zarom

print(cl.headers)
Maybe your variables are here?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question