When i pass the Authorization Bearer in header, it gives me this error:
The header name format is invalid.
This is how i'm passing it:
where client is a HttpClient variable and json.accessToken is the value of the token.
If you download the tool Postman you can easily check how this works.
After you revieced your token, you just have to put into Header:
Value: Bearer YOUR_TOKEN
including the whitespace between Baerer and your token!
I get nothing but 401s using this very approach in Postman.
client.DefaultRequestHeaders.Add("Authorization",string.Concat("Bearer ", json.accessToken));
We’re a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.