The call from my website works fine in my local machine in Visual studio localhost, but when I go live the website works but calls to the external APIs do not work.
API link in my local machine (works fine) https://localhost:44308/api/PackageAPI/FlightAmadeus1/RUH/LON/2020-06-08/2020-06-09/1/0/null/null/null/null
Live API, does not work https://www.example.com/api/PackageAPI/FlightAmadeus1/RUH/LON/2020-06-08/2020-06-09/1/0/null/null/null/null
Sorry I am new to ASP.NET and appreciate your help.
This is the webs config file in the live server (Hostgator asp.net windows hosting)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\mydomain.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 9d04498f-9409-4c42-9f7d-15bc0851e5a3-->
Error from live server log fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1] An unhandled exception has occurred while executing the request. System.Net.Http.HttpRequestException: An attempt was made to access a socket in a way forbidden by its access permissions. ---> System.Net.Sockets.SocketException (10013): An attempt was made to access a socket in a way forbidden by its access permissions. at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) --- End of inner exception stack trace ---
Aucun commentaire:
Enregistrer un commentaire