Adding header at factory creation? #241
-
How do I add an header when creating the client? I wan't to add a default dynamic header (apikey), but I can't find out how in the Readme.
I would like to chain `.AddDefaultHeader("key", "value");
What are my options right now? What am I missing? Pass around an object that holds my dynamic headers and then use ut like:
? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Oh. I found out. Was not to clear to me.
|
Beta Was this translation helpful? Give feedback.
-
You can configure the HttpClient as your question proposes (there's an overload of AddRestEaseClient which lets you do that), or you can add tha header as a property on your interface, and then there's an overload of AddRestEaseClient which lets you set that property when the interface is instantiated. |
Beta Was this translation helpful? Give feedback.
Oh. I found out. Was not to clear to me.