public string this[HttpResponseHeader header] { get { if (!AllowHttpResponseHeader) { throw new InvalidOperationException(SR.net_headers_rsp); } return(this[header.GetName()]); } set { if (!AllowHttpResponseHeader) { throw new InvalidOperationException(SR.net_headers_rsp); } if (_type == WebHeaderCollectionType.HttpListenerResponse) { if (value != null && value.Length > ushort.MaxValue) { throw new ArgumentOutOfRangeException("value", value, SR.Format(SR.net_headers_toolong, ushort.MaxValue)); } } this[header.GetName()] = value; } }
public void Remove(HttpResponseHeader header) { if (!AllowHttpResponseHeader) { throw new InvalidOperationException(SR.net_headers_rsp); } this.Remove(header.GetName()); }
public void Set(HttpResponseHeader header, string?value) { if (!AllowHttpResponseHeader) { throw new InvalidOperationException(SR.net_headers_rsp); } this.Set(header.GetName(), value); }
public string this[HttpResponseHeader header] { get { if (!AllowHttpResponseHeader) { throw new InvalidOperationException(SR.net_headers_rsp); } return(this[header.GetName()]); } set { if (!AllowHttpResponseHeader) { throw new InvalidOperationException(SR.net_headers_rsp); } this[header.GetName()] = value; } }
public void Add(HttpResponseHeader header, string value) { if (!AllowHttpResponseHeader) { throw new InvalidOperationException(SR.net_headers_rsp); } if (_type == WebHeaderCollectionType.WebResponse) { if (value != null && value.Length > ushort.MaxValue) { throw new ArgumentOutOfRangeException(nameof(value), value, string.Format(CultureInfo.InvariantCulture, SR.net_headers_toolong, ushort.MaxValue)); } } this.Add(header.GetName(), value); }
public string this[HttpResponseHeader header] { get { if (!AllowHttpResponseHeader) { throw new InvalidOperationException(SR.net_headers_rsp); } return this[header.GetName()]; } set { if (!AllowHttpResponseHeader) { throw new InvalidOperationException(SR.net_headers_rsp); } this[header.GetName()] = value; } }
public string this[HttpResponseHeader header] { get { if (!AllowHttpResponseHeader) { throw new InvalidOperationException(SR.net_headers_rsp); } return this[header.GetName()]; } set { if (!AllowHttpResponseHeader) { throw new InvalidOperationException(SR.net_headers_rsp); } if (_type == WebHeaderCollectionType.HttpListenerResponse) { if (value != null && value.Length > ushort.MaxValue) { throw new ArgumentOutOfRangeException("value", value, SR.Format(SR.net_headers_toolong, ushort.MaxValue)); } } this[header.GetName()] = value; } }