I have been seeking to upload an image to Imgur using the API end-point for upload. I tested the API end-point with Postman. It works fine and here is what Postman gave as the code for the cURL request.
Now I try making the POST request in AppInventor and get an error. The Imgur server rejects the POST request with 400 status ("Bad request").
I have tried the following:
- POST text with Content-Type as "mutipart/form-data"
- POST file with Content-Type as "image/jpeg"
- Structuring information with Dictionary or List-of-Lists
None of these have worked.
The file location is hardcoded for testing. I have tried working with the image in the following ways:
- Using the object captured by camera in App Inventor
- Using the object stashed in the "Selection" attribute of ImagePicker
- Converting image to base64 string (offline) and passing the string.
Based on the Postman code, I have hardcoded the filepath in the example. None of these have worked either.
Can you please suggest other options to try, including perhaps an alternative image hosting service known to work with AppInventor? I would like to avoid installing an extension unless absolutely necessary.