Cannot make C# RestClient work reliably for long API response time

1,436 views
Skip to first unread message

Nguyễn Nam

unread,
Apr 28, 2022, 11:32:35 PM4/28/22
to RestSharp

I need to talk to a third-party system through HTTP POST requests - depending on the parameters of such requests, it happens that processing time exceeds 5 minutes.

Request starts -> Wait until whatever timeout i have set on RestClient is triggered -> Timeout Exception. In other words, it appears that the response being sent by the server is "ignored" and the component waits for timeout. I are able to successfully make request from the same machine by using CURL or Postman, so I doubt it's machine-dependent.

Of course, the timeout is higher than the server response time, and i can confirm that the server is actually processing & sending the response through.

Size of the response payload does not change significantly with processing time - it seems that the only variable here is processing time itself.

Any clue / ideas for troubleshooting this?

Editing to add code (.NET Core 3.1):

Reply all
Reply to author
Forward
0 new messages