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
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
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.
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.
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