· 6 years ago · Jan 23, 2020, 08:30 AM
1API_ENDPOINT = "http://pastebin.com/api/api_post.php"
2 # your API key here
3 API_KEY = "014f370476ef77822cd3d31184ee9bd0"
4
5 # your source code here
6 source_code = license
7
8 # data to be sent to api
9 data = {'api_dev_key':API_KEY,
10 'api_option':'paste',
11 'api_paste_code':source_code,
12 'api_paste_format':'python'}
13
14 # sending post request and saving response as response object
15 r = requests.post(url = API_ENDPOINT, data = data)
16
17 response = r.content