Hi,
How would you recommend to handle the following need:
I have an application which configures an
HttpClient
to reach a REST API. This client is consumed through a business logic layer injected as a singleton in my DI graph (at app start).
I currently inject the
HttpClient
in this business logic ctor class.
I might need intermediate setup to fully configure this
HttpClient
, typically, I'll get the root URL of the REST API after being authorized/authenticated.
My business logic layer relies on "relative" endpoints,
rest/api/foo/bar
and I don't want to expose the root URL in this layer, which may vary depending on the DI setup (prod/preprod, specific setup…).
Until now, I didn't have the constraint of knowing the root URL afterwards, it was known at app start which is not the case anymore.
So, I'd like to update on the fly the
defaultRequest
block of the client ideally, is it the way to go, how?