RESTAPI - Connection closed by the server
Application Type
Traditional Web
Platform Version


I am consuming a RESTAPI inside a foreach, but on the 3-4 request i am getting the following error: 

The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. 

My first thought was that the endpoint server was closing the connection as the error suggests, then i created a simple nodejs code that calls the same endpoint several times, and in none of them i got the same error.

I debugged the application, and while doing it, all calls worked as expected. It seems to have worked because there was a time interval between each call.

Any ideas on how to solve this or to do a 'wait' inside the server action?



Hi Rafael,

You can use Sleep component from the Forge to implement 'waits' before each REST call.



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