Imgur API does not change the description of an existing image

I use queries in Python 2.7 to try to change the description of a previously uploaded image using the API. According to Imgur API Guide, I used this:

r = requests.post('https://api.imgur.com/3/image/'+submission['id'], \
               headers={'Authorization':'Bearer '+access_token}, \
               data={'description':'blahblahblah'}, verify=False)

What I get in return:

{u'status': 200, u'data': False, u'success': True}

So, as far as I can see, OAUTH works fine, but the API itself returns “False” and the description does not change. I find no further guidance regarding this particular endpoint. Any ideas?

+5
source share
3 answers

Perhaps try request.put instead of request.post (you want to modify an existing resource, not create one)

0
source

( perl), / API imgur v3, , , , , : "Content-Type: application/json" . 200/success, . API , .

0

I know an old question, but maybe this will help someone. It works for me.

Add title:

'Content-Type': 'application/json'

And requests.postuse jsoninsteaddata

r = requests.post(url,
     headers={'Authorization':'Bearer '+access_token, 'Content-Type': 'application/json'},
     json={'description':'blahblahblah'}, verify=False)
0
source

All Articles