Flurl website document shows it has a configuration which allows to pass in Delegating Handlers.
https://flurl.dev/docs/configuration/
It would be at the end of the above link.
All code is configured in the Program class. This is azure function app, running on isolated worker model.
While the clientless pattern in static clients format works, the DI pattern doesnt.
Above works, but not sure calling service provider like that is good idea in the Program class. This is the hostbuilder.ConfigureServices section and calling BuildServiceProvider in the middle is not good.
What can i be doing wrong in the below DI version of the code.
Flurl website document shows it has a configuration which allows to pass in Delegating Handlers. https://flurl.dev/docs/configuration/ It would be at the end of the above link.
All code is configured in the Program class. This is azure function app, running on isolated worker model.
While the clientless pattern in static clients format works, the DI pattern doesnt.
Above config works.
But this pattern below doesnt.
I need the DI format, because my CustomDelegationHandler has other classes injected into it and it would have been easier if the DI version worked.
Since I dont have an interface, I used the below format. Wasnt sure about Interfaces for DelegatingHandlers.
Sample DelegationHandler being used:
So my code becomes:
Above works, but not sure calling service provider like that is good idea in the Program class. This is the hostbuilder.ConfigureServices section and calling BuildServiceProvider in the middle is not good.
What can i be doing wrong in the below DI version of the code.
https://stackoverflow.com/questions/78653878/how-to-configure-delegating-handler-in-flurl-clientless-configuration Created a stackoverflow version if anyone else had the same question. Thanks