I have an ASP.NET Core Web API which is deployed on a server. When I access the Web API endpoint through Postman, I am getting the result, but not when calling through .NET code (HttpClient), instead I'm getting the errors. However, the ASP.NET Core Web API is just working fine when it's running on local machine.
Errors
1 or 4 Error : HttpRequestException: An error occurred while sending the request.
2 or 4 Error : WebException: The underlying connection was closed: An unexpected error occurred on a send.
3 or 4 Error : IOException: Unable to read data from the transport connection: An existing
4 or 4 Error : connection was forcibly closed by the remote host.
When deployed on server, why is it only working through Postman - or when API is running locally?