public static IEnumerable <AuthHeaderInfo> GetAuthenticationHeaderInfo([NotNull] this IRestResponse response, AuthHeader header)
        {
            var headerName = header.ToAuthenticationHeaderName();

            return(response
                   .Headers.GetValues(headerName)
                   .SelectMany(ParseAuthenticationHeader)
                   .ToList());
        }
Пример #2
0
        public static IEnumerable <AuthHeaderInfo> GetAuthenticationHeaderInfo([NotNull] this IHttpResponseMessage response, AuthHeader header)
        {
            var headerName = header.ToAuthenticationHeaderName();
            IEnumerable <string> headerValues;

            if (!response.Headers.TryGetValues(headerName, out headerValues))
            {
                headerValues = _emptyHeaderValues;
            }
            return(headerValues
                   .SelectMany(ParseAuthenticationHeader)
                   .ToList());
        }
 /// <summary>
 /// Get all authentication header information
 /// </summary>
 /// <param name="response">The response to get the authentication header from</param>
 /// <param name="header">The header to query (WWW or proxy)</param>
 /// <returns>All authentication header information items</returns>
 public static IEnumerable<AuthHeaderInfo> GetAuthenticationHeaderInfo(this IHttpResponseMessage response, AuthHeader header)
 {
     var headerName = header.ToAuthenticationHeaderName();
     IEnumerable<string> headerValues;
     if (!response.Headers.TryGetValues(headerName, out headerValues))
         headerValues = _emptyHeaderValues;
     return headerValues
         .Select(x => new AuthHeaderInfo(x))
         .ToList();
 }
 /// <summary>
 /// Get all authentication header information
 /// </summary>
 /// <param name="response">The response to get the authentication header from</param>
 /// <param name="header">The header to query (WWW or proxy)</param>
 /// <returns>All authentication header information items</returns>
 public static IEnumerable<AuthHeaderInfo> GetAuthenticationHeaderInfo(this IRestResponse response, AuthHeader header)
 {
     var headerName = header.ToAuthenticationHeaderName();
     return response
         .Headers.GetValues(headerName)
         .Select(x => new AuthHeaderInfo(x))
         .ToList();
 }
        public static IEnumerable<AuthHeaderInfo> GetAuthenticationHeaderInfo([NotNull] this IHttpResponseMessage response, AuthHeader header)
        {
            var headerName = header.ToAuthenticationHeaderName();
            IEnumerable<string> headerValues;
            if (!response.Headers.TryGetValues(headerName, out headerValues))
            {
                headerValues = _emptyHeaderValues;
            }

            return headerValues
                .SelectMany(ParseAuthenticationHeader)
                .ToList();
        }
 public static IEnumerable<AuthHeaderInfo> GetAuthenticationHeaderInfo([NotNull] this IRestResponse response, AuthHeader header)
 {
     var headerName = header.ToAuthenticationHeaderName();
     return response
         .Headers.GetValues(headerName)
         .SelectMany(ParseAuthenticationHeader)
         .ToList();
 }