Beispiel #1
0
        internal static void RemoveHeader(this HttpResponseMessage httpResponseMessage, string header)
        {
            Fx.Assert(httpResponseMessage != null, "The 'httpResponseMessage' parameter should never be null.");
            Fx.Assert(!string.IsNullOrWhiteSpace(header), "The 'header' parameter should never be null or whitespace.");

            HttpHeaderInfo headerInfo = HttpHeaderInfo.Create(header);

            EnsureNotRequestHeader(headerInfo);
            RemoveHeader(httpResponseMessage, headerInfo);
        }
        internal static IEnumerable <string> GetHeader(this HttpRequestMessage httpRequestMessage, string header)
        {
            Fx.Assert(httpRequestMessage != null, "The 'httpRequestMessage' parameter should never be null.");
            Fx.Assert(!string.IsNullOrWhiteSpace(header), "The 'header' parameter should never be null or whitespace.");

            HttpHeaderInfo headerInfo = HttpHeaderInfo.Create(header);

            EnsureNotResponseHeader(headerInfo);
            return(GetHeader(httpRequestMessage, headerInfo));
        }