/// <summary>
        ///     Attempts to retrieve the value of a response header.
        /// </summary>
        /// <param name="response"></param>
        /// <param name="name"></param>
        /// <returns>The first value if one is found, null otherwise.</returns>
        public static string GetHeader([NotNull] this RegistryApiResponse response, string name)
        {
            if (response == null)
            {
                throw new ArgumentNullException(nameof(response));
            }

            return(response.Headers
                   .FirstOrDefault(h => h.Key == name).Value?.FirstOrDefault());
        }
Example #2
0
 internal UnauthorizedApiException(RegistryApiResponse response) : base(response)
 {
 }