I'm using HttpClient PostAsync to a server that will provide an authentication token in the response header. The header name is "Authorization". How can I get this value?
Asked
Active
Viewed 70 times
1 Answers
0
System.Collections.Generic.List<string> authHeaders = (System.Collections.Generic.List<string>)response.Headers.GetValues("Authorization");
authHeaders[0];

E-Madd
- 4,414
- 5
- 45
- 77
-
1While this code may answer the question, it is better to explain how to solve the problem and provide the code as an example or reference. Code-only answers can be confusing and lack context. – Robert Columbia Jun 12 '18 at 01:16