What we have implemented currently is something like this: https://v3.flurl.dev/docs/configuration/#httpclientfactory with the CustomHttpClientFactory
being a BearerTokenManagingHttpClientFactory
which inherits DefaultHttpClientFactory and overrides CreateHttpClient()
and CreateMessageHandler()
methods. It adds some headers in the override of CreateHttpClient
and returns something called BearerTokenMessageHandler
object in the override of CreateMessageHandler
. BearerTokenMessageHandler
itself inherits DelegatingHandler
.
Now, I did got through the upgrade guide, but I’m having difficulty in migrating from 3.x to 4.0 especially. I want to understand what’s the 4.0 equivalent code for
var cli = new FlurlClient(BASE_URL).Configure(settings => {
settings.HttpClientFactory = new MyCustomHttpClientFactory();
});