I have installed latest RestSharp NuGet package version (106.3.1) on my C# solution and when I make a request that takes much longer than usual (most of my requests take little time), then the request never returns back to the caller. Although I am working to make this fully async, I am intrigued why this is happening. Please see below a small snipped of my source code.
// Private RestClient variable relative to my class.
private RestClient _client;
// Request made to another service inside my method
RestRequest restRequest = new RestRequest("api/abc/def", Method.POST);
restRequest.AddParameter("Authorization", $"Bearer {token}", ParameterType.HttpHeader);
restRequest.AddHeader("Accept", "application/json");
var serializeObject = JsonConvert.SerializeObject(requestOp);
restRequest.AddParameter("Application/Json", serializeObject, ParameterType.RequestBody);
var restResponse = this._client.Execute(restRequest);
Please notice that I am making at the moment one request at the time. There are no other requests happening in parallel whatsoever but only when the request takes a bit longer than usual, it simply does not return. No timeouts, nothing... Any idea what could this be?
EDIT: When I debug the code on the server side, it returns to the caller with a return this.Ok(requestOutput);
However, the response never gets received by the caller.