Created
February 2, 2018 11:25
-
-
Save m4rc1e/b16cf27b081ebf2e16f4988d4888f94e to your computer and use it in GitHub Desktop.
Anonymously post an image to imgur v3 api
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 requests | |
import json | |
img_path = 'foo/img_path.jpg' | |
r = requests.post('https://api.imgur.com/3/image', | |
data={'image': open(img_path, 'rb').read(), 'type': 'file' }, | |
headers = {'Authorization': 'Client-ID {{Your-CLIENT-ID}}'} | |
) | |
print r.json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment