Hi there,


I have consumed a REST API in my web application. In order to transfer files in the API call, in the header, I have implemented the content-Type of multipart/form-data.

When I tested with small files (around 8-10kb), the API call can go through successfully. However, when I turned to use normal excel or PDF files which are around 200-500kb, the API calls failed.

At the very beginning, I thought it was due to the size of the files. So I tested in Postman with even larger files. They all got through. So, obviously, the key issue is not about the file size.

Then I fetched the exception message - "the underlying connection was closed: An unexpected error occurred on a send".

I've seen quite a few posts related to this error message. And a few key terms mentioned include updating the .NET Framework, version of TLS certificate, etc. But none explains how to check or modify the specs in the Outsystems service studio environment or web service centre.

To share more insights with you guys, I attached the sreenshot of the service centre stack error messages.

So, any hints would be great. Thanks in advance.


Regards,

Andy Y

What version of the OutSystems platform are you using? What version of Service Studio?

Can you share an OML with a small repro of the issue?

Is the API in question publicly available? If so, can you post the endpoint URL?


i have the same issue, im trying to consume an API but it always results in "The underlying connection was closed: An unexpected error occurred on a send".

I've Tried using Postman and its working. so does anyone knows what is the solution ? i'm using Outsystems 11


Hi Andy,

Consuming a multipart form data REST API is not so straight forward to implement. Kilian Hekhuis actually wrote a great article about it.

I would suggest to read it:

https://www.outsystems.com/blog/posts/consuming-multipart-form-data-rest-method/

And a sample Forge application:

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

Learning by example many times help to get quicker results.

Hope the additional info and sample code will help you.

Regards,

Daniel