refit
refit copied to clipboard
DelegatingHandler not having HttpClient or HttpClientFactory set ?
I am trying to access the HttpClient's base address in the DelegatingHandler (AuthHeaderHandler), but it's not set.
services.AddTransient<AuthHeaderHandler>();
services.AddRefitClient<ICubsApiClient>()
.ConfigureHttpClient(c => c.BaseAddress = new System.Uri("https://domain.refit"))
.AddHttpMessageHandler<AuthHeaderHandler>();
Seems to me I have to setup another HttpClient if i want this to work ?
In my AuthHeaderHandler i am doing this:
public AuthHeaderHandler(IHttpClientFactory httpClientFactory, IConfiguration config)
Thank you