Sounds like a DNS issue on the server the web site is hosted on. Maybe add a host file entry for the url you are trying to hit on the web server(s)
unable to call external payment gateway api via dotnet code
Hi All
Please provide your inputs, suggestions.
I have an application deployed in IIS and calling an external api service which is working via POSTMAN and as well as from browser.
But when the same API is called via code and executed via IIS through front end application, it gives an error as below
System.net.Http.HttpRequestException: No such host is known
System.net.Sockets.SocketException (11001): No such host is known
At System.net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, Cancellationtoken cancellationtoken)
O/S: Windows Server 2019
IIS: IIS 10.0.xx
Front End app: React
Web services: REST APIs using Dotnet Core 3.1 hosted on IIS
Database: SQL Server 2017
POSTMAN: works
Browser: works
But when the code executed via IIS it gives us the above error.
Any help
thanks
ram
2 answers
Sort by: Most helpful
-
-
AgaveJoe 27,696 Reputation points
2022-01-21T12:57:16.577+00:00 Can you clarify? You installed PostMan and Chrome on the server and both applications can access the api URL from the server? If so, then there is a problem with the code. Most likely the URL is incorrect. What is the URL the application is trying to access?