[REQ] New C# Generator that uses HttpClient instead of RestSharp
Created by: hannahchan
The existing C# generators produce clients that rely on the RestSharp library instead of the built-in System.Net.Http.HttpClient. This is particularly annoying if you're building apps using the ASP.NET Typed HttpClient pattern. In addition because the generated clients don't use System.Net.Http.HttpClient, it's impossible (or not very obvious) where you would add delegating handlers to handle cross-cutting concerns that span across all requests. Examples of cross-cutting concerns might be request logging, trace header propagation and retry logic.
What I would like to see is an alternative C# generator that would generate code to support developers in using the Typed HttpClient pattern.
For information about the System.Net.Http.HttpClient API. https://docs.microsoft.com/dotnet/api/system.net.http.httpclient
For information about making requests with System.Net.Http.HttpClient. https://docs.microsoft.com/aspnet/core/fundamentals/http-requests
For a quick guide to System.Net.Http.HttpClient and Delegating Handlers, I highly recommend the first half of this talk. https://youtu.be/ojDxK_-I-To