Created
June 30, 2021 01:13
-
-
Save WillianFuks/5fdea58e95562cbe4ee3665d2ae61034 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
sess = requests.Session() | |
sess.verify = False # For testing locally | |
sess.post('https://localhost:8002/login/', | |
data={'username': 'alice', 'password': 'pass'}) | |
sess.headers.update({'X-CSRFToken': sess.cookies['csrftoken']}) | |
r = sess.get('https://localhost:8002/protect/') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment