B
B
beduin012018-05-03 18:05:26
Python
beduin01, 2018-05-03 18:05:26

How to log in to the site using requests?

I have an example of authorization via curl. I can't figure out how to do the same with python requests.
curl -u vasia:12345
What to write here:

myrequest = json.loads(x)
r = requests.post(url, json=myrequest)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2018-05-04
@beduin01

requests.get(url, auth=('vasia', '12345'))

W
wegres, 2018-05-03
@wegres

Convert curl syntax to Python, Node.js, PHP
https://curl.trillworks.com/#

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question