so am having a little trouble with the anonymous imgur API.
If I go to http://api.imgur.com/2/upload.json - this clearly returns JSON.
If I go to http://api.imgur.com/2/upload.json?key=ANONAPIKEY&image=http:/ - this also returns a JSON formatted error.
However, If I actually try and upload a valid image, say :
this now returns XML.
Could anyone explain this ? Am I doing something wrong ?
Thanks
Encode your URL before sending it over. This should work, for example:
You can encode your URL in Javascript using encodeURIComponent()
Example:
var url = "http://api.imgur.com/2/upload.json?key=ANONAPIKEY&image=" + encodeURIComponent("http://www.utra.ca/Pictures/Projects/reprap.jpg")