I have the following code:
...
AuthenticationHeaderValue authHeaders = new AuthenticationHeaderValue(\"OAuth2\", Contract.AccessToken);
string result = await
This line
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(authValue.Parameter);
Will produce this header value
Authorization: ACCESS_TOKEN
Where ACCESS_TOKEN
is the value of authValue.Parameter
. You want to assign the value you passed instead to get the required header
client.DefaultRequestHeaders.Authorization = authValue;
Will produce
Authorization: OAuth2 ACCESS_TOKEN