Skip to main content

Posts

Showing posts with the label #Web

#HTTPRequestHeader- How to get an specific header value from the HttpResponseMessage

How to get an specific header value from the HttpResponseMessage You should be able to use the TryGetValues method. HttpHeaders headers = response . Headers ; IEnumerable <string> values ; if ( headers . TryGetValues ( "X-BB-SESSION" , out values )) {         string session = values . First (); } Note: First() is an extension method; include System.Linq to get access to it.