At first the problem is simple but I'm wasting weeks with this.
I have a WEB API developed in .NetCore and inside it I make requests to other APIs, locally I don't have any problems, but when I upload the application to the server and I see the application logs it gives me the following error:
The connection attempt failed because the connected party did not respond properly after a period of time, or established connection failed because connected host has failed to respond.
I'm using the Restsharp library to make the requests
var url = "urlDoEndPoint";
var cliente = new RestClient(url);
cliente.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", informacoes, ParameterType.RequestBody);
IRestResponse response = cliente.Execute(request);
if (response.IsSuccessful)
{
dynamic retorno = JObject.Parse(response.Content);
return true;
}
And as said above, locally it runs perfectly, but inside the server it has this timeout problem
I've tried to see several issues of ports, certificates and so on. I'm currently hosting the application in the self-hosted model, where I run it as a windows service.
I don't know if this is a problem with my application in general or if there's something wrong with the body of my request because locally everything runs perfectly