Basic Auth with HttpFactory #417
-
How can I add authorization header to my GET request when using
|
Beta Was this translation helpful? Give feedback.
Answered by
yurii-hunter
Sep 11, 2021
Replies: 1 comment 1 reply
-
Hi @igoldin74! Do the default request headers work for you? The solution may look something like this var httpFactory = ClientFactory.Create(name: "http_factory",
clientCount: 1,
initClient: (number, context) =>
{
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "Your Oauth token here");
return Task.FromResult(client);
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
igoldin74
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @igoldin74! Do the default request headers work for you? The solution may look something like this