How do I upload to an imgur user's account

て烟熏妆下的殇ゞ 提交于 2019-12-04 16:15:11

I figured it out. Instead of sending a "CLIENT-ID" header, you need to send a "BEARER" header, with the token that you recieve by using imgur's oauth 2 api. This allows you to post images to a user's account, whereas before I only providewd the client id, which allowed me to post anonymous images. The code looks like this:

client.Headers.Add("Authorization", "BEARER " + accessToken);

To add to Ivan Chub's answer... I just got stuck uploading to my imgur account in python for a minute until I tried changing BEARER to Bearer.

req.add_header("Authorization", "Bearer " + imgur_access_token)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!