Error accessing the REST service from Xamarin Forms

I have a REST WebAPI service running in another solution. I was sucessful to reach and test the service using Postman in the URL: https://localhost:44322/api/CareerPath/GetActiveCareerPaths

I followed the steps mentioned in the Xamarin course to consume my WebAPI Service

System.Net.Http.HttpRequestException: ‘Could not connect to the server.’

I’m usning Visual Studio 2022 Community for Windows 11.

Following is the configuration I have for the iOS project:

After an intensive search I found there is no way to directly access local apis running on Kestrel. To access them we need to do a kind of “tunneling” by the use of another tool.

I solved this by using ngrok. You need to create a free account to deal with this and download the exe file and run it locally. It’s very lightweight and fast and solves the problem.

ngrok.com