OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.79k stars 6.57k forks source link

[REQ] Support using System.Net.Http.SocketsHttpHandler in csharp with the httpclient library #19789

Open segevfiner opened 1 month ago

segevfiner commented 1 month ago

Is your feature request related to a problem? Please describe.

Newer .NET versions have a new default handler for HttpClient: System.Net.Http.SocketsHttpHandler, but the current csharp client uses HttpClientHandler, it would be nice to support using the newer SocketsHttpHandler when available or as a separate library template.

Describe the solution you'd like

Support using SocketsHttpHandler in the csharp and httpclient library generator.

Describe alternatives you've considered

Modify the templates locally by myself.

Additional context

https://learn.microsoft.com/en-us/dotnet/api/system.net.http.socketshttphandler?view=net-8.0

devhl-labs commented 1 month ago

Did you try generichost? I think it will let you.