How to pass binary-data into an API URL?

Hello,

I am trying to upload image to imgbb.com website using its API. This API takes image as a URL parameter. whenI am testing this example URL "https://api.imgbb.com/1/upload?expiration=600&key=YOUR_CLIENT_API_KEY&image=R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" in postman than it is working fine. But how to achieve the same with outsystems as outsystems does not support binary data in URL. I tried to convert binary-data to base64. But than it is showing Request URL too large. Does anyone has used this API before or have any idea how to use this API in outsystems.

Thanks

mvp_badge
MVP

Hi Neha,


In order to send a binary on REST, you'll have to have the method of the webservice as POST and send the binary on the Body, like on the image below:




Kind Regards,
João

Hello,

Thanks for your reply, But I think this API does not have request body, it passes parameters in URL only. According to the description given here ->  https://api.imgbb.com/

mvp_badge
MVP

You didn't mention you had a specification which makes it hard to guess :)

On the specification it mentions, you have to use POST to overcome this issue:


Are you using POST method?

yes, I am using post method only. I attached the oml file.

Thanks 

UploadImage.oml

Hi, Neha.

Did you try Multipart/form-data component, from Forge?

https://www.outsystems.com/forge/component-overview/4026/multipart-form-data

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.