Consuming a web service from a mobile app
Apple’s App Transport Security (ATS) forces developers to use good practice, including secure connections between an app and a web service. ATS is enabled by default and your mobile apps will throw an exception if they do not connect securely. Since Android 9, Google has had a similar policy.
If you need to call a web service that is secured with a self-signed certificate like our Northwind.Maui.WebApi.Service
project is, it is possible but complicated. For simplicity, we will allow unsecure connections to the web service and disable the security checks in the mobile app.
Creating a Minimal API web service for customers
We will create a web service for working with customers in the Northwind database:
- In the
Chapter18
solution, add a web service project, as defined in the following list:- Project template: ASP.NET Core Web API/
webapi --use-minimal-apis
- Workspace/solution file and folder:
Chapter18...
- Project template: ASP.NET Core Web API/