Hi Everyone,
I am doing an integration by calling a web service API. I need to pass the file in the request body. In postman there is option to upload the file in the body. how can I do the same in OutSystems. The Content-Type is multipart/form-data
Below there is a image of how it is done in PostMan.
Please provide a solution on how I can send the file in the request
Hi Lincy Thomson,
This documentation will help you to do your task, I hope.https://success.outsystems.com/documentation/11/integration_with_external_systems/rest/consume_rest_apis/consuming_a_rest_api_with_a_multipart_or_form_data_method/
Thanks
Deepak M
Yes, this is the only documentation one should look at. It explains how to consume a multipart/form-data REST API.
hi Lincy Thomson,you can create a request body in outsystems with a help of forge component useful for consuming REST services that need this format instead of the more common (and OutSystems supported) JSON.
https://www.outsystems.com/forge/component-overview/4026/multipart-form-data-o11
follow blow discussion this might be helpful to get your desired output.
How to use form-data API request ?Request is an Image , Response is a Json - POST
hope this might be helpful.
Hi @Lavanya-EONE ,
Thanks for this. As I am new to OutSystems, Can you please help me how we can make use of this forge component While consuming the API.
Hi @Lincy Thomson,
Good Day!!!
The Component already has a demo, Please check that.
Thanks,Vignesh Prakash.
Hi @lincy Thomson ,Here i have-not shared any APIs i just created dummy Api and mentioned where to use a MultipartFormDataCreate for your reference. in the multipartformdatacreate server action you can call the API and Assign the input from multipartformdatacreate which converts the input to required form.
Refer this Discussion for more information.
Do not use or recommend this Asset, unless you want to expose a multipart/form-data REST API. The Platform has multipart/form-data built-in nowadays, so there's no need to use this Asset.
thank you
Hi Lincy ,
https://www.youtube.com/watch?v=CeCh-UsemDQ
Please visit this link ..at the end its is mentioned in the video how to upload image...
It might help you.