Make MemoryWebClient
a Typed HttpClient
#633
aaronpowell
started this conversation in
2. Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context / Scenario
The
MemoryWebClient
class is mostly a wrapper aroundHttpClient
in .NET, but it doesn't follow the pattern of a Typed HttpClient, which means that it's difficult to integrate with the .NET application hosts.As a result, configuring the
HttpClient
is cumbersome, and also doesn't allow you to do your own auth delegation.The problem
An application should be able to do this:
Since it is added using the
AddHttpClient
method, we can call methods likeAddHttpMessageHandler
,AddPolicyHandler
, configure the endpoint, or even integrate it with .NET Aspire (where the backend is another Aspire component).Proposed solution
Refactor the
MemoryWebClient
to take aHttpClient
as the only constructor argument, making it configurable using the Typed HttpClient pattern.Importance
would be great to have
Beta Was this translation helpful? Give feedback.
All reactions