/// <summary> /// Return all headers except for content-type, accept, accept-encoding and accept-charset /// </summary> /// <returns></returns> public Dictionary <string, string> HeaderForEverythingElse() { return (_headers.Where( x => !HeaderType.GetAll() .Any(y => y.Value.Equals(x.Key, StringComparison.InvariantCultureIgnoreCase))) .ToDictionary(x => x.Key, x => x.Value)); }
/// <summary> /// Return all headers except for content-type, accept, accept-encoding and accept-charset /// </summary> /// <returns></returns> public NameValueCollection HeaderForEverythingElse() { var keepHeaders = _headers.AllKeys.Except(HeaderType.GetAll().Select(t => t.Value)); var headers = new NameValueCollection(); foreach (var header in keepHeaders) { foreach (var value in _headers.GetValues(header)) { headers.Add(header, value); } } return(headers); }