Created
June 29, 2021 23:11
-
-
Save WillianFuks/75648c2c034f032085b14cbc3f91f4ba 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 | |
r = sess.post('https://localhost:8002/login/', | |
data={'username': 'alice', 'password': 'pass'}) | |
sess.headers.update({'AUTHORIZATION': f'Bearer {r.json()["access"]}'}) | |
r = sess.post('https://localhost:8002/validate_access/') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment