Hello All,
I am Consuming the 3rd party REST API with Form URL Encoded Request. I need to send a request with address which is of structure
How can I able to pass the record as a input for the Form URL Encoded Request?.
I have already gone through some of the reference but didn't found any solution
https://www.outsystems.com/forums/discussion/36156/guide-consume-rest-api-with-form-url-encoded-request/
https://www.outsystems.com/forums/discussion/61827/rest-api-form-url-encoded-requests-list-type-input-parameter-error/
Thanks and Regards,
Ellakkiya.S
Hi Ellakkiya,
Simple put, you cannot do this out of the box with OutSystems. Complex data types like collections and lists aren't standardized across REST services with form URL encoding (see also this topic). The best you can do is constructing the payload manually, and send a single Body parameter of type Text with that payload.
Hey,While consuming API, you have to pass structure as json with value and test it, when click on test button response get automatically created and request body also get created.
Hope this will understandable.
Thanks
Yogesh
Hello Yogesh Javir ,
Thankyou for your reply
My request format is Form URL Encoded, so i cannot able to pass the json
Hi Ellakiya,
When i create a bogus consumed rest API with form url encoding this is what happens:
So, for each field there will be an input parameter in the rest method. You can simply point each attribute in your structure/record to the desired input param of the API method.
Hello Stefano Valente ,
Yes Exactly, This works fine.
I need to pass the address structure, you can refer the above screenshot i have attached.
Hope this is clear!
Thanks and regards,
I am not an expert with this content-type, but i am quite sure you can't send structures, only fields.
Since you are bound to that content-type, i think my example is the only way.
I hope it will fix your problem and answer your question. If so, please choose a post as solution to close this topic.