Whenever I visit this URL in my browser, it works fine and the file uploads to my account:
http://api.imgur.com/2/upload.json?key=<my key>&image=<url to image>
But when I attempt to retrieve it in PHP with something like file_get_contents
, I get this error message:
Warning: file_get_contents(<URL>): failed to open stream:
HTTP request failed! HTTP/1.1 400 Bad Request
You can see an example with this URL: http://api.imgur.com/2/upload.json?key=&image=https://www.google.com/images/srpr/logo3w.png
Edit: I also attempted to use a user agent but to no avail.