Skip to content

Instantly share code, notes, and snippets.

@kyanny
Created Oct 5, 2021
Embed
What would you like to do?
import urllib.request
import os
import json
token = os.getenv('GITHUB_TOKEN')
headers = {
'Authorization': f'token {token}'
}
url = 'https://api.github.com/user/repos'
req = urllib.request.Request(url, None, headers)
with urllib.request.urlopen(req) as res:
print(res.read().decode('utf8'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment