# A Simple API Client

Wrap an API in a client class, the way a DAO wraps a table. It's given an HttpClient, has one async method per endpoint, and turns 404 into null or false, so the rest of the program never sees a URL, a status code or JSON.

![Cheat sheet: A Simple API Client](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/062eba03f6c04455bece0def3f905c76.webp)

- Category: C#
- Level: Journeyman
- Tags: API Client, c-sharp, Dependency Injection (oop), Encapsulation (c-sharp), rest-api
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/calling-apis-with-httpclient-using-a-simple-http-client-cheat-sheet
