C
C
Casti6662021-03-19 22:01:48
Python
Casti666, 2021-03-19 22:01:48

How to load cookies in python requests?

6054f4ad5d578632549612.jpeg
I want to make a post request with loaded cookies of this kind, I tried a lot of things, nothing happens. Can someone tell me?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2021-03-19
@hottabxp

import requests

headers = {'user-Agent': 'Mozilla/5.0'}
cookies = {'key1':'value1','key2':'value2'}

response = requests.get(url,headers=headers,cookies=cookies)

You can also pass cookies directly in the header.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question