During the course of building an API, it is very likely that you will have to consume other API services.
- For example, you may have to consume a payment API for processing payment.
- For example, you may have to consume Bing Maps API because you are using Bing Maps SDK to generate some random addresses.
In such scenarios, you will have use web libraries to consume APIs.
note: the code useful as a reference. The example API used in the code, is no longer real. but you can use your own API endpoint and the code should work.
TODO: Update the code to work with a live API, perhaps the NASA APOD API.
- https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=net-5.0 - the main http web api calling client.
- https://restsharp.dev/getting-started/ - used to call web api. popular library.
- https://quicktype.io/ - used for conversion between json and c # POCO classes.
find ways to hire me, follow me and stay in touch with me.