Unable to get imgur v3 api request for authorization using curl or other bash utility

I am trying to clear some public data from imgur.com using the v3 imgur api , but whenever I make a request using curl, m gets 401.

Here is how I call the API ( using this example from the python application sample ) -

curl -F "Authorization=Client-ID <my_client_id_provided_by_registering_my_app>" https://api.imgur.com/3/gallery/hot/viral/0.json

I also tried

curl -F "client_id=<my_client_id>" https://api.imgur.com/3/gallery/hot/viral/0.json

So my question is: what format is imgur api expecting an auth header, and how can I use it with curl or some other common bash utility?

+4
source share
1 answer

-F ( --form) HTTP-. -H (--header):

curl --header "Authorization: Client-ID $YOUR_ID" https://api.imgur.com/3/gallery/hot/viral/0.json
+5

Source: https://habr.com/ru/post/1529690/


All Articles