64
Views
4
Comments
Solved
form-encoded base64 image string parameter throwing error
Question
Application Type
Service
Service Studio Version
11.53.22 (Build 61488)

Hi, while implementing a REST API with form-encoded input, I ran into this issue.. While testing on Postman, the following input yields a success response (see image1). But in Outsystems, I got the following return error from the API (see image2). 

I'm a bit new to Outsystems so I would like to if there's any request format that I'm getting wrong, or any issues that can be rectified. Thanks!


2023-08-28 09-08-29
Venkatesh Sundarajan
Solution

I have used this component below to pass form data into my request, 

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

In my case I had multiple parameters in request. 

This component will help to frame our request for form encoded type of request. 

Please try. 

2023-08-28 09-08-29
Venkatesh Sundarajan

Hi Ryan, 

It looks like you are able to hit the endpoint, means the way you are calling is correct.(you got a response) 

Please try with another set of values or recheck your implementation.

Few links, related to form url encoded format api calls, 

https://www.outsystems.com/forums/discussion/53989/consume-api-object-format-for-x-www-form-urlencoded/

https://www.outsystems.com/forums/discussion/53944/consume-api-with-content-type-application-x-www-form-urlencoded/

Hope this helps! 

2023-08-28 09-08-29
Venkatesh Sundarajan
Solution

I have used this component below to pass form data into my request, 

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

In my case I had multiple parameters in request. 

This component will help to frame our request for form encoded type of request. 

Please try. 

UserImage.jpg
Ryan Toh

Thanks for the reply. I have tried and it works. Upon further inspection of the API, I noticed that Outsystems does not automatically encode the base64 text to a url friendly text when using form encoded. So I called the outsystems EncodeURL to my base64 string and it works as intended too.  Will include here for future reference

2023-08-28 09-08-29
Venkatesh Sundarajan
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.