Created
December 4, 2018 06:37
-
-
Save Shellbye/90ad6272425099bcb9a78dea0df20e66 to your computer and use it in GitHub Desktop.
python3 authentication bearer demo
This file contains hidden or 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 urllib.request | |
headers = {"Authorization":"Bearer eyJhbGciOiJIUzUxMiJ1.eyJzdWIiOiJhZG1pbiIsImF1dGhvcml0aWVzIjpbIlJPTEVfQURNSU4iXSwiaWF0IjoxNTQzOTA0NTY5LCJleHAiOjE1NDM5OTA5Njl9.0MLfJa9oud0ZMNC2e0q8YciuuB1G56KZH3m87ilrd7ryy4sjtR2U0MQnWSd89u-liWo1gLAgX9OyIDUnFXzJUw"} | |
req = urllib.request.Request(url="http://127.0.0.1:8090", headers=headers) | |
contents = urllib.request.urlopen(req).read() | |
print(contents) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment