Our great sponsors
-
RestEase
Easy-to-use typesafe REST API client library for .NET Standard 1.1 and .NET Framework 4.5 and higher, which is simple and customisable. Inspired by Refit
Use RestEase to create your own client library. Refit is a very similar and more popular library. IMO RestEase is an improvement over Refit and I prefer it, but either will solve your problems. Both are libs that have you build interfaces describing the API endpoints, then the library handles all the boilerplate code that calls HttpClient.
-
Refit
The automatic type-safe REST library for .NET Core, Xamarin and .NET. Heavily inspired by Square's Retrofit library, Refit turns your REST API into a live interface.
Use RestEase to create your own client library. Refit is a very similar and more popular library. IMO RestEase is an improvement over Refit and I prefer it, but either will solve your problems. Both are libs that have you build interfaces describing the API endpoints, then the library handles all the boilerplate code that calls HttpClient.
-
SonarLint
Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.
-
Use RestSharp to create a client library. It requires you to write more code, but it's still a lot less boilerplate than using HttpClient directly.
-
I would also add flurl to that list https://flurl.dev/. It's an amazing library and can be super helpful for quick one off API calls.