If my user agent is a constant string, I can use [Headers("User-Agent: Awesome Octocat App")]
to set it.
However, My user agent is generated by a method (because it includes the device and OS version), which means I can't put it inside the Headers
attribute.
The other mentioned method is as described in the Dynamic Headers section, which is less than optimal since this is a global header for me. I'd rather not manually add this header to the 60+ API methods.
How would I go about doing this? Is it a supported scenario? Using a custom HttpClient is an acceptable solution (if possible).
I'm also open to other similar products if you know of any that may serve my purpose.