Beispiel #1
0
        /// <summary>
        /// Maps the headers from the <see cref="HttpResponseMessage"/> to the response.
        /// </summary>
        /// <param name="httpResponseMessage">The <see cref="HttpResponseMessage."/></param>
        /// <param name="response">The response.</param>
        /// <exception cref="ArgumentNullException">The value of '<paramref name="httpResponseMessage"/>' and '<paramref name="response"/>' cannot be null. </exception>
        private void MapResponseHeaders([NotNull] HttpResponseMessage httpResponseMessage, [NotNull] ResponseBase response)
        {
            if (httpResponseMessage == null)
            {
                throw new ArgumentNullException(nameof(httpResponseMessage));
            }

            if (response == null)
            {
                throw new ArgumentNullException(nameof(response));
            }

            var responseHeaderCollection = HttpHeaderCollection.FromHttpResponseMessage(httpResponseMessage);

            this.responseHeaderMapper.MapHeaders(response, responseHeaderCollection);
        }