I have the following scenario:
HttpClientsHttpMessageHandler called MyCustomHandlerservices
.AddHttpClient<TeamCity.Client>()
.AddHttpMessageHandler(() => new MyCustomHandler())
services
.AddHttpClient<GitHub.Client>()
.AddHttpMessageHandler(() => new MyCustomHandler())
TeamCity.Client is actually intercepting requests made through GitHub.Client ?I don't understand what is happening here?
AddHttpClient<>()) named or typed clients?What's going on here is that these clients end up with the same name because the the class names are the same Client. This isn't great 馃槩 I'm going to see if I can make this report an exception instead, because this is confusing an unintended.
You can also pass a name when adding a typed client with AddHttpClient, which should help keep them separated.
馃憤
Most helpful comment
What's going on here is that these clients end up with the same name because the the class names are the same
Client. This isn't great 馃槩 I'm going to see if I can make this report an exception instead, because this is confusing an unintended.You can also pass a name when adding a typed client with
AddHttpClient, which should help keep them separated.