|
87 | 87 | ## Remarks
|
88 | 88 | The <xref:System.Net.WebHeaderCollection> class is generally accessed through <xref:System.Net.WebRequest.Headers%2A?displayProperty=nameWithType> or <xref:System.Net.WebResponse.Headers%2A?displayProperty=nameWithType>.
|
89 | 89 |
|
90 |
| - On .NET Framework, some common headers are considered restricted and are either exposed directly by the API (such as `Content-Type`) or protected by the system and cannot be changed. This does *not* apply to .NET Core and .NET 5+ - none of the headers are restricted there. |
| 90 | + On .NET Framework, some common headers are considered restricted and are either exposed directly by the API (such as `Content-Type`) or protected by the system and cannot be changed. This does *not* apply to .NET Core and .NET 5+, where none of the headers are restricted. |
91 | 91 |
|
92 | 92 | The restricted headers are:
|
93 | 93 |
|
|
302 | 302 | > The length of the *value* portion of `header`, that is, the string after the colon (:), is validated only in .NET Framework and .NET Core versions 2.0 - 3.1.
|
303 | 303 | > - On all applicable .NET Framework versions: A <xref:System.Net.WebHeaderCollection> instance that's returned by the <xref:System.Net.HttpListenerResponse.Headers%2A> property will throw an <xref:System.ArgumentOutOfRangeException> if the length of the *value* portion of `header` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a *value* of any length.
|
304 | 304 | > - On .NET Core versions through version 3.1: A <xref:System.Net.WebHeaderCollection> instance used with any header of type <xref:System.Net.HttpResponseHeader> will throw an <xref:System.ArgumentOutOfRangeException> if the length of the *value* portion of `header` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a *value* of any length.
|
305 |
| -> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a *value* of any length. |
| 305 | +> - On .NET 5 and later versions: <xref:System.Net.WebHeaderCollection> accepts a *value* of any length. |
306 | 306 | ]]></format>
|
307 | 307 | </remarks>
|
308 | 308 | <exception cref="T:System.ArgumentNullException">
|
|
383 | 383 | > The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1.
|
384 | 384 | > - On all applicable .NET Framework versions: A <xref:System.Net.WebHeaderCollection> instance that's returned by the <xref:System.Net.HttpListenerResponse.Headers%2A> property will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
385 | 385 | > - On .NET Core versions through version 3.1: A <xref:System.Net.WebHeaderCollection> instance used with any header of type <xref:System.Net.HttpResponseHeader> will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
386 |
| -> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
| 386 | +> - On .NET 5 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
387 | 387 | ]]></format>
|
388 | 388 | </remarks>
|
389 | 389 | <exception cref="T:System.ArgumentOutOfRangeException">.NET Framework and .NET Core versions 2.0 - 3.1 only: The length of <paramref name="value" /> is greater than 65535.</exception>
|
|
447 | 447 | > The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1.
|
448 | 448 | > - On all applicable .NET Framework versions: A <xref:System.Net.WebHeaderCollection> instance that's returned by the <xref:System.Net.HttpListenerResponse.Headers%2A> property will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
449 | 449 | > - On .NET Core versions through version 3.1: A <xref:System.Net.WebHeaderCollection> instance used with any header of type <xref:System.Net.HttpResponseHeader> will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
450 |
| -> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
| 450 | +> - On .NET 5 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
451 | 451 | ]]></format>
|
452 | 452 | </remarks>
|
453 | 453 | <exception cref="T:System.ArgumentOutOfRangeException">.NET Framework and .NET Core versions 2.0 - 3.1 only: The length of <paramref name="value" /> is greater than 65535.</exception>
|
|
521 | 521 | > The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1.
|
522 | 522 | > - On all applicable .NET Framework versions: A <xref:System.Net.WebHeaderCollection> instance that's returned by the <xref:System.Net.HttpListenerResponse.Headers%2A> property will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
523 | 523 | > - On .NET Core versions through version 3.1: A <xref:System.Net.WebHeaderCollection> instance used with any header of type <xref:System.Net.HttpResponseHeader> will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
524 |
| -> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
| 524 | +> - On .NET 5 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
525 | 525 | ]]></format>
|
526 | 526 | </remarks>
|
527 | 527 | <exception cref="T:System.ArgumentException">
|
|
593 | 593 | > The length of `headerValue` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1.
|
594 | 594 | > - On all applicable .NET Framework versions: A <xref:System.Net.WebHeaderCollection> instance that's returned by the <xref:System.Net.HttpListenerResponse.Headers%2A> property will throw an <xref:System.ArgumentOutOfRangeException> if the length of `headerValue` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `headerValue` of any length.
|
595 | 595 | > - On .NET Core versions through version 3.1: A <xref:System.Net.WebHeaderCollection> instance used with any header of type <xref:System.Net.HttpResponseHeader> will throw an <xref:System.ArgumentOutOfRangeException> if the length of `headerValue` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `headerValue` of any length.
|
596 |
| -> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `headerValue` of any length. |
| 596 | +> - On .NET 5 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `headerValue` of any length. |
597 | 597 | ]]></format>
|
598 | 598 | </remarks>
|
599 | 599 | <exception cref="T:System.ArgumentException">
|
|
1516 | 1516 | > The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1.
|
1517 | 1517 | > - On all applicable .NET Framework versions: A <xref:System.Net.WebHeaderCollection> instance that's returned by the <xref:System.Net.HttpListenerResponse.Headers%2A> property will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
1518 | 1518 | > - On .NET Core versions through version 3.1: A <xref:System.Net.WebHeaderCollection> instance used with any header of type <xref:System.Net.HttpResponseHeader> will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
1519 |
| -> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
| 1519 | +> - On .NET 5 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
1520 | 1520 | ]]></format>
|
1521 | 1521 | </remarks>
|
1522 | 1522 | <exception cref="T:System.ArgumentOutOfRangeException">.NET Framework and .NET Core versions 2.0 - 3.1 only: The length of <paramref name="value" /> is greater than 65535.</exception>
|
|
1914 | 1914 | > The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1.
|
1915 | 1915 | > - On all applicable .NET Framework versions: A <xref:System.Net.WebHeaderCollection> instance that's returned by the <xref:System.Net.HttpListenerResponse.Headers%2A> property will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
1916 | 1916 | > - On .NET Core versions through version 3.1: A <xref:System.Net.WebHeaderCollection> instance used with any header of type <xref:System.Net.HttpResponseHeader> will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
1917 |
| -> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
| 1917 | +> - On .NET 5 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
1918 | 1918 | ]]></format>
|
1919 | 1919 | </remarks>
|
1920 | 1920 | <exception cref="T:System.ArgumentOutOfRangeException">.NET Framework and .NET Core versions 2.0 - 3.1 only: The length of <paramref name="value" /> is greater than 65535.</exception>
|
|
1978 | 1978 | > The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1.
|
1979 | 1979 | > - On all applicable .NET Framework versions: A <xref:System.Net.WebHeaderCollection> instance that's returned by the <xref:System.Net.HttpListenerResponse.Headers%2A> property will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
1980 | 1980 | > - On .NET Core versions through version 3.1: A <xref:System.Net.WebHeaderCollection> instance used with any header of type <xref:System.Net.HttpResponseHeader> will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
1981 |
| -> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
| 1981 | +> - On .NET 5 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
1982 | 1982 | ]]></format>
|
1983 | 1983 | </remarks>
|
1984 | 1984 | <exception cref="T:System.ArgumentOutOfRangeException">.NET Framework and .NET Core versions 2.0 - 3.1 only: The length of <paramref name="value" /> is greater than 65535.</exception>
|
|
2052 | 2052 | > The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1.
|
2053 | 2053 | > - On all applicable .NET Framework versions: A <xref:System.Net.WebHeaderCollection> instance that's returned by the <xref:System.Net.HttpListenerResponse.Headers%2A> property will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
2054 | 2054 | > - On .NET Core versions through version 3.1: A <xref:System.Net.WebHeaderCollection> instance used with any header of type <xref:System.Net.HttpResponseHeader> will throw an <xref:System.ArgumentOutOfRangeException> if the length of `value` is greater than 65535. All other <xref:System.Net.WebHeaderCollection> instances accept a `value` of any length.
|
2055 |
| -> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
| 2055 | +> - On .NET 5 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
2056 | 2056 | ]]></format>
|
2057 | 2057 | </remarks>
|
2058 | 2058 | <exception cref="T:System.ArgumentNullException">
|
|
0 commit comments