26
Views
4
Comments
data-binary in Ousystems rest api call
Discussion

How to execute below curl query in outsystems rest api Consume Rest API calls


curl -X POST "https://moderate-waiting-admission.trycloudflare.com/document/send" \

-H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" \

--data-binary @data1.txt

2023-03-16 16-29-51
Paulo Rosário

Hello JP K,

Please refer to this article for more information on how to consume a multipart /form-data API in Outsystems.

Consuming a REST API with a multipart or form data method.

Hope it helps!

Paulo Rosário


UserImage.jpg
JP K

Hi Paulo,

how to set --data-binary @data1.txt   ??

i have stored all the multipart form data fields in data1.txt file so i need to call this.... it's working properly in curl command.

2023-03-16 16-29-51
Paulo Rosário

As I understand it that should be an Input on the REST call.

You can use the TextToBinary function from the Binary Extension to convert your Txt file into Binary 

Then use something like Binary Split from the Forge to set your Binary boundaries and send them throughout the API.

2023-03-08 10-32-19
Vinod Kumar R

Hi @JP K,


Boundary generates some kind of GUID based on the file you upload everytime.

You can use the below forge to get the boundary and pass into your API call.

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

Regards,

Vinod

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