public TempOtpViewModel GetTempTop(TempOtpViewModel model)
{
RestClient client = new RestClient(_appSettings.DalUrl);
RestRequest request = new RestRequest("account/GetTempOtp", Method.POST);
request.AddJsonBody(model);
IRestResponse response = client.Execute(request);
HttpStatusCode statusCode = response.StatusCode;
int numericStatusCode = (int)statusCode;
_logger.LogCritical("Serilog " + numericStatusCode);
return null;
}
I am calling this API after I receive an OTP via SMS. It is returning status code 0 with an empty response.
However, if I wait for 2 seconds before calling it, it will work perfectly.
Any idea on what might be causing this issue?
Note that this issue is only happening in one environment. Our app is hosted in 2 environments is working properly in the other one.