Relative Content

Tag Archive for flurl

How to move away from CustomHttpClientFactory in Flurl 4.0?

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.