41
Views
9
Comments
Solved
Web Service API

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

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Yes, this is the only documentation one should look at. It explains how to consume a multipart/form-data REST API.

UserImage.jpg
Lavanya A

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.



UserImage.jpg
Lincy Thomson

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.

2024-05-22 06-12-56
Vignesh Prakash

Hi @Lincy Thomson

Good Day!!!

The Component already has a demo, Please check that.


Thanks,
Vignesh Prakash.

UserImage.jpg
Lavanya A

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. 

multiport.oml
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

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.

2023-08-18 10-40-36
Deepak M
Solution
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Yes, this is the only documentation one should look at. It explains how to consume a multipart/form-data REST API.

UserImage.jpg
Garima Sharma

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.


Thanks

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