How to get an specific header value from the HttpResponseMessage
You should be able to use the
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.
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.
Comments
Post a Comment