Created
October 5, 2021 16:26
-
-
Save kyanny/cd0bfb9f4bf0eea8d54f3a6e039f1459 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 urllib.request | |
import os | |
import json | |
token = os.getenv('GITHUB_TOKEN') | |
data = { | |
'text': '**hello** __world__', | |
} | |
headers = { | |
'Content-Type': 'application/json', | |
'Authorization': f'token {token}' | |
} | |
url = 'https://api.github.com/markdown' | |
req = urllib.request.Request(url, json.dumps(data).encode(), 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