|
290 | 290 | [!code-csharp[WebHeaderCollection_Add#1](~/samples/snippets/csharp/VS_Snippets_Remoting/WebHeaderCollection_Add/CS/webheadercollection_add.cs#1)] |
291 | 291 | [!code-vb[WebHeaderCollection_Add#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebHeaderCollection_Add/VB/webheadercollection_add.vb#1)] |
292 | 292 | |
| 293 | +> [!NOTE] |
| 294 | +> 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. |
| 295 | +> - 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. |
| 296 | +> - 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. |
| 297 | +> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a *value* of any length. |
293 | 298 | ]]></format> |
294 | 299 | </remarks> |
295 | 300 | <exception cref="T:System.ArgumentNullException"> |
|
310 | 315 | -or- |
311 | 316 |
|
312 | 317 | The value part of <paramref name="header" /> contains invalid characters.</exception> |
313 | | - <exception cref="T:System.ArgumentOutOfRangeException">The length the string after the colon (:) is greater than 65535.</exception> |
| 318 | + <exception cref="T:System.ArgumentOutOfRangeException">.NET Framework and .NET Core versions 2.0 - 3.1 only: The length of the string after the colon (:) is greater than 65535.</exception> |
314 | 319 | </Docs> |
315 | 320 | </Member> |
316 | 321 | <Member MemberName="Add"> |
|
364 | 369 | |
365 | 370 | If the specified header is already present, `value` is added to the comma-separated list of values associated with the header. |
366 | 371 | |
| 372 | +> [!NOTE] |
| 373 | +> The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1. |
| 374 | +> - 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. |
| 375 | +> - 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. |
| 376 | +> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
367 | 377 | ]]></format> |
368 | 378 | </remarks> |
369 | | - <exception cref="T:System.ArgumentOutOfRangeException">The length of <paramref name="value" /> is greater than 65535.</exception> |
| 379 | + <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> |
370 | 380 | <exception cref="T:System.InvalidOperationException">This <see cref="T:System.Net.WebHeaderCollection" /> instance does not allow instances of <see cref="T:System.Net.HttpRequestHeader" />.</exception> |
371 | 381 | </Docs> |
372 | 382 | </Member> |
|
421 | 431 | |
422 | 432 | If the specified header is already present, `value` is added to the comma-separated list of values associated with the header. |
423 | 433 | |
| 434 | +> [!NOTE] |
| 435 | +> The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1. |
| 436 | +> - 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. |
| 437 | +> - 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. |
| 438 | +> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
424 | 439 | ]]></format> |
425 | 440 | </remarks> |
426 | | - <exception cref="T:System.ArgumentOutOfRangeException">The length of <paramref name="value" /> is greater than 65535.</exception> |
| 441 | + <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> |
427 | 442 | <exception cref="T:System.InvalidOperationException">This <see cref="T:System.Net.WebHeaderCollection" /> instance does not allow instances of <see cref="T:System.Net.HttpResponseHeader" />.</exception> |
428 | 443 | </Docs> |
429 | 444 | </Member> |
|
489 | 504 | [!code-csharp[WebHeaderCollection_Add#1](~/samples/snippets/csharp/VS_Snippets_Remoting/WebHeaderCollection_Add/CS/webheadercollection_add.cs#1)] |
490 | 505 | [!code-vb[WebHeaderCollection_Add#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebHeaderCollection_Add/VB/webheadercollection_add.vb#1)] |
491 | 506 | |
| 507 | +> [!NOTE] |
| 508 | +> The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1. |
| 509 | +> - 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. |
| 510 | +> - 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. |
| 511 | +> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
492 | 512 | ]]></format> |
493 | 513 | </remarks> |
494 | 514 | <exception cref="T:System.ArgumentException"> |
|
501 | 521 | -or- |
502 | 522 |
|
503 | 523 | <paramref name="value" /> contains invalid characters.</exception> |
504 | | - <exception cref="T:System.ArgumentOutOfRangeException">The length of <paramref name="value" /> is greater than 65535.</exception> |
| 524 | + <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> |
505 | 525 | </Docs> |
506 | 526 | </Member> |
507 | 527 | <Member MemberName="AddWithoutValidate"> |
|
555 | 575 | ## Remarks |
556 | 576 | The <xref:System.Net.WebHeaderCollection.AddWithoutValidate%2A> method adds a header to the collection without checking whether the header is on the restricted header list. |
557 | 577 | |
| 578 | +> [!NOTE] |
| 579 | +> The length of `headerValue` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1. |
| 580 | +> - 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. |
| 581 | +> - 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. |
| 582 | +> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `headerValue` of any length. |
558 | 583 | ]]></format> |
559 | 584 | </remarks> |
560 | 585 | <exception cref="T:System.ArgumentException"> |
|
564 | 589 |
|
565 | 590 | <paramref name="headerValue" /> contains invalid characters.</exception> |
566 | 591 | <exception cref="T:System.ArgumentOutOfRangeException"> |
567 | | - <paramref name="headerName" /> is not <see langword="null" /> and the length of <paramref name="headerValue" /> is too long (greater than 65,535 characters).</exception> |
| 592 | + .NET Framework and .NET Core only: <paramref name="headerName" /> is not <see langword="null" /> and the length of <paramref name="headerValue" /> is too long (greater than 65,535 characters).</exception> |
568 | 593 | <block subset="none" type="overrides"> |
569 | 594 | <para>Use the <see cref="M:System.Net.WebHeaderCollection.AddWithoutValidate(System.String,System.String)" /> method to add headers that are normally exposed through properties.</para> |
570 | 595 | </block> |
|
1453 | 1478 | <param name="header">The response header value.</param> |
1454 | 1479 | <summary>Gets or sets the specified response header.</summary> |
1455 | 1480 | <value>A <see cref="T:System.String" /> instance containing the specified header.</value> |
1456 | | - <remarks>To be added.</remarks> |
1457 | | - <exception cref="T:System.ArgumentOutOfRangeException">The length of <paramref name="value" /> is greater than 65535.</exception> |
| 1481 | + <remarks> |
| 1482 | + <format type="text/markdown"><![CDATA[ |
| 1483 | + |
| 1484 | +## Remarks |
| 1485 | +
|
| 1486 | +> [!NOTE] |
| 1487 | +> The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1. |
| 1488 | +> - 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. |
| 1489 | +> - 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. |
| 1490 | +> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
| 1491 | + ]]></format> |
| 1492 | + </remarks> |
| 1493 | + <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> |
1458 | 1494 | <exception cref="T:System.InvalidOperationException">This <see cref="T:System.Net.WebHeaderCollection" /> instance does not allow instances of <see cref="T:System.Net.HttpResponseHeader" />.</exception> |
1459 | 1495 | </Docs> |
1460 | 1496 | </Member> |
|
1837 | 1873 | |
1838 | 1874 | If the header specified in `header` is already present, `value` replaces the existing value. |
1839 | 1875 | |
| 1876 | +> [!NOTE] |
| 1877 | +> The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1. |
| 1878 | +> - 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. |
| 1879 | +> - 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. |
| 1880 | +> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
1840 | 1881 | ]]></format> |
1841 | 1882 | </remarks> |
1842 | | - <exception cref="T:System.ArgumentOutOfRangeException">The length of <paramref name="value" /> is greater than 65535.</exception> |
| 1883 | + <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> |
1843 | 1884 | <exception cref="T:System.InvalidOperationException">This <see cref="T:System.Net.WebHeaderCollection" /> instance does not allow instances of <see cref="T:System.Net.HttpRequestHeader" />.</exception> |
1844 | 1885 | </Docs> |
1845 | 1886 | </Member> |
|
1894 | 1935 | |
1895 | 1936 | If the header specified in `header` is already present, `value` replaces the existing value. |
1896 | 1937 | |
| 1938 | +> [!NOTE] |
| 1939 | +> The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1. |
| 1940 | +> - 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. |
| 1941 | +> - 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. |
| 1942 | +> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
1897 | 1943 | ]]></format> |
1898 | 1944 | </remarks> |
1899 | | - <exception cref="T:System.ArgumentOutOfRangeException">The length of <paramref name="value" /> is greater than 65535.</exception> |
| 1945 | + <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> |
1900 | 1946 | <exception cref="T:System.InvalidOperationException">This <see cref="T:System.Net.WebHeaderCollection" /> instance does not allow instances of <see cref="T:System.Net.HttpResponseHeader" />.</exception> |
1901 | 1947 | </Docs> |
1902 | 1948 | </Member> |
|
1962 | 2008 | [!code-csharp[WebHeaderCollection_Set#1](~/samples/snippets/csharp/VS_Snippets_Remoting/WebHeaderCollection_Set/CS/webheadercollection_set.cs#1)] |
1963 | 2009 | [!code-vb[WebHeaderCollection_Set#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebHeaderCollection_Set/VB/webheadercollection_set.vb#1)] |
1964 | 2010 | |
| 2011 | +> [!NOTE] |
| 2012 | +> The length of `value` is validated only in .NET Framework and .NET Core versions 2.0 - 3.1. |
| 2013 | +> - 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. |
| 2014 | +> - 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. |
| 2015 | +> - On .NET 5.0 and later versions: <xref:System.Net.WebHeaderCollection> accepts a `value` of any length. |
1965 | 2016 | ]]></format> |
1966 | 2017 | </remarks> |
1967 | 2018 | <exception cref="T:System.ArgumentNullException"> |
1968 | 2019 | <paramref name="name" /> is <see langword="null" /> or <see cref="F:System.String.Empty" />.</exception> |
1969 | | - <exception cref="T:System.ArgumentOutOfRangeException">The length of <paramref name="value" /> is greater than 65535.</exception> |
| 2020 | + <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> |
1970 | 2021 | <exception cref="T:System.ArgumentException"> |
1971 | 2022 | <paramref name="name" /> is a restricted header. |
1972 | 2023 |
|
|
0 commit comments