Skip to content

Instantly share code, notes, and snippets.

@Shellbye
Last active December 4, 2018 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shellbye/697cda89773d3eb899a74af17c285fdb to your computer and use it in GitHub Desktop.
Save Shellbye/697cda89773d3eb899a74af17c285fdb to your computer and use it in GitHub Desktop.
python2 authentication bearer demo
import urllib2
headers = {"Authorization":"Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImF1dGhvcml0aWVzIjpbIlJPTEVfQURNSU4iXSwiaWF0IjoxNTQzOTA0NTY5LCJleHAiOjE1NDM5OTA5Njl9.1MLfJa9oud0ZMNC2e0q8YciuuB1G56KZH3m87ilrd7ryy4sjtR2U0MQnWSd89u-liWo1gLAgX9OyIDUnFXzJUw"}
req = urllib2.Request(url="http://127.0.0.1:8090", headers=headers)
contents = urllib2.urlopen(req).read()
print(contents)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment