-1

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?

E-Madd
  • 4,414
  • 5
  • 45
  • 77
  • Possible duplicate of [How to get an specific header value from the HttpResponseMessage](https://stackoverflow.com/questions/25439421/how-to-get-an-specific-header-value-from-the-httpresponsemessage) – Dalton Cézane Oct 17 '18 at 20:01

1 Answers1

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
  • 1
    While 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