/// <summary>
        /// Initializes a new instance of the <see cref="DefaultHttpResponseMessage"/> class.
        /// </summary>
        /// <param name="requestMessage">The request message for this response</param>
        /// <param name="responseMessage">The response message to wrap</param>
        /// <param name="cookies">Container of cookies to query the cookies from</param>
        /// <param name="exception">The exception that occurred during the request</param>
        public DefaultHttpResponseMessage([NotNull] IHttpRequestMessage requestMessage, [CanBeNull] HttpWebResponse responseMessage, [CanBeNull] CookieContainer cookies, [CanBeNull] WebException exception = null)
        {
            ResponseMessage = responseMessage;
            _exception      = exception;
            _requestMessage = requestMessage;

            var responseHeaders = new GenericHttpHeaders();
            var contentHeaders  = new GenericHttpHeaders();

            if (responseMessage != null && responseMessage.HasHeaderSupport())
            {
                foreach (var headerName in responseMessage.Headers.AllKeys)
                {
                    IHttpHeaders headers;
                    if (headerName.StartsWith("Content-", StringComparison.OrdinalIgnoreCase))
                    {
                        headers = contentHeaders;
                    }
                    else
                    {
                        headers = responseHeaders;
                    }

                    headers.TryAddWithoutValidation(headerName, responseMessage.Headers[headerName]);
                }
            }

            Content = new HttpWebResponseContent(contentHeaders, responseMessage);
            Headers = responseHeaders;
            Cookies = cookies;
        }