Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SERVICES: Add service method to set the HttpClient Authorization header #35

Closed
mabroukmahdhi opened this issue May 20, 2022 · 2 comments

Comments

@mabroukmahdhi
Copy link

Hello,

Is it possible to add (or maybe there is) a way to set the Authorization request header to the httpClient inside RESTFulApiFactoryClient

Mybe something like that:

public void SetAuthenticationHeaderValue(AuthenticationHeaderValue authenticationHeaderValue)
            => this.httpClient.DefaultRequestHeaders.Authorization = authenticationHeaderValue;

Thanks!

@hassanhabib
Copy link
Owner

Why not just set it in the httpClient you pass in during the instantiation of RESTfulSenseFactory

@mabroukmahdhi
Copy link
Author

Thank you @hassanhabib

Now I have it working in my code 🌷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants