Can the BaseAddress be changed after the service is injected? #1410
Replies: 3 comments
-
Have you ever found an answer for this? I only can get it working like below but this not overriding, changing, rather getting a new instance with a new url.
|
Beta Was this translation helpful? Give feedback.
-
I never got an answer and I don't remember if I could do it after injection , but here is how I did it: Setup:
Injection of Http Client:
use in a method to set the base address
Hopefully this helps. |
Beta Was this translation helpful? Give feedback.
-
I find it interesting because the generated code exposes a client where you should be able to change the base address, but it is not available for use
I would like to find out more why that is not available. |
Beta Was this translation helpful? Give feedback.
-
Hi, I would like to change the base address on particular api endpoints that have been injected with a refit service. Is this posssilbe, or can I only do it when Getting a required service?
here is the set up for that service:
and Here is the service:
Beta Was this translation helpful? Give feedback.
All reactions