From 96ec3dfb71c2ebe0d5b603675050663676f8268d Mon Sep 17 00:00:00 2001 From: antonfirsov Date: Mon, 17 Mar 2025 23:50:49 +0100 Subject: [PATCH 1/8] Improve HttpClient exception docs --- xml/System.Net.Http/HttpClient.xml | 297 +++++++++++++++++--- xml/System.Net.Http/HttpResponseMessage.xml | 3 +- 2 files changed, 256 insertions(+), 44 deletions(-) diff --git a/xml/System.Net.Http/HttpClient.xml b/xml/System.Net.Http/HttpClient.xml index 4e8bd348933..61908762a9e 100644 --- a/xml/System.Net.Http/HttpClient.xml +++ b/xml/System.Net.Http/HttpClient.xml @@ -531,8 +531,8 @@ This property has no effect on any of the - - + + Method @@ -600,7 +600,11 @@ The is not an absolute URI. -or- is not set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -673,7 +677,11 @@ The is not an absolute URI. -or- is not set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -752,7 +760,11 @@ The is not an absolute URI. -or- is not set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -831,7 +843,11 @@ The is not an absolute URI. -or- is not set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -974,7 +990,11 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -1039,7 +1059,11 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -1180,7 +1204,11 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. @@ -1251,7 +1279,11 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -1317,7 +1349,11 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + TThe request failed due to an issue getting an HTTP response such as network connectivity, DNS failure or server certificate validation. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -1393,7 +1429,11 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. @@ -1466,7 +1506,11 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -1548,6 +1592,9 @@ The is not an absolute URI. ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. + Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. + In such cases we recommend to use the method and check if matches the expected value(s). > [!NOTE] > In case of timeout, different exceptions are thrown on different .NET implementations. @@ -1557,7 +1604,15 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -1613,6 +1668,9 @@ The is not an absolute URI. ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. + Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. + In such cases we recommend to use the method and check if matches the expected value(s). > [!NOTE] > In case of a timeout: @@ -1623,7 +1681,15 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation (or timeout for .NET Framework only). + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -1675,6 +1741,9 @@ The is not an absolute URI. ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. + Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. + In such cases we recommend to use the method and check if matches the expected value(s). > [!NOTE] > In case of a timeout: @@ -1684,7 +1753,11 @@ The is not an absolute URI. ]]> - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation (or timeout for .NET Framework only). + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard). The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. @@ -1737,6 +1810,9 @@ The is not an absolute URI. ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. + Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. + In such cases we recommend to use the method and check if matches the expected value(s). > [!NOTE] > In case of a timeout: @@ -1746,7 +1822,12 @@ The is not an absolute URI. ]]> - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation (or timeout for .NET Framework only). + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) + The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -1828,6 +1909,9 @@ The is not an absolute URI. ## Remarks This operation doesn't block. The returned [Task\](xref:System.Threading.Tasks.Task%601) object will complete after the response headers are read. This method does not read or buffer the response body. + Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. + In such cases we recommend to use the method and check if matches the expected value(s). > [!NOTE] > In case of a timeout: @@ -1837,7 +1921,15 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation (or timeout for .NET Framework only). + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -1893,6 +1985,9 @@ The is not an absolute URI. ## Remarks This operation doesn't block. The returned [Task\](xref:System.Threading.Tasks.Task%601) object will complete after the response headers are read. This method does not read nor buffer the response body. + Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. + In such cases we recommend to use the method and check if matches the expected value(s). > [!NOTE] > In case of a timeout: @@ -1902,7 +1997,15 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation (or timeout for .NET Framework only). + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -1954,6 +2057,9 @@ The is not an absolute URI. ## Remarks This operation doesn't block. The returned [Task\](xref:System.Threading.Tasks.Task%601) object will complete after the response headers are read. This method does not read nor buffer the response body. + Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. + In such cases we recommend to use the method and check if matches the expected value(s). > [!NOTE] > In case of a timeout: @@ -1968,7 +2074,11 @@ The is not an absolute URI. .NET Core and .NET 5 and later only: The request failed due to timeout. The is . - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation (or timeout for .NET Framework only). + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard). The provided request URI is not valid relative or absolute URI. @@ -2016,6 +2126,9 @@ The is not an absolute URI. ## Remarks This operation doesn't block. The returned [Task\](xref:System.Threading.Tasks.Task%601) object will complete after the response headers are read. This method does not read nor buffer the response body. + Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. + In such cases we recommend to use the method and check if matches the expected value(s). > [!NOTE] > In case of a timeout: @@ -2025,7 +2138,11 @@ The is not an absolute URI. ]]> The is . - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation (or timeout for .NET Framework only). + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard). The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -2107,6 +2224,9 @@ The is not an absolute URI. ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. + Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. + In such cases we recommend to use the method and check if matches the expected value(s). > [!NOTE] > In case of a timeout: @@ -2116,7 +2236,15 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation (or timeout for .NET Framework only). + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -2172,6 +2300,9 @@ The is not an absolute URI. ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. + Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. + In such cases we recommend to use the method and check if matches the expected value(s). > [!NOTE] > In case of a timeout: @@ -2181,7 +2312,15 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation (or timeout for .NET Framework only). + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -2233,6 +2372,9 @@ The is not an absolute URI. ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. + Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. + In such cases we recommend to use the method and check if matches the expected value(s). > [!NOTE] > In case of a timeout: @@ -2242,7 +2384,11 @@ The is not an absolute URI. ]]> The is . - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation (or timeout for .NET Framework only). + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard). The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. @@ -2295,6 +2441,9 @@ The is not an absolute URI. ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. + Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. + In such cases we recommend to use the method and check if matches the expected value(s). > [!NOTE] > In case of a timeout: @@ -2304,7 +2453,11 @@ The is not an absolute URI. ]]> The is . - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation (or timeout for .NET Framework only). + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard). The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -2420,6 +2573,9 @@ The size specified is greater than the maximum allowed buffer size. ]]> + The must be an absolute URI or must be set. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -2474,6 +2630,9 @@ The size specified is greater than the maximum allowed buffer size. ]]> + The must be an absolute URI or must be set. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to timeout. @@ -2536,8 +2695,10 @@ The size specified is greater than the maximum allowed buffer size. ]]> + The must be an absolute URI or must be set. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The cancellation token was canceled or the request failed due to timeout. The provided request URI is not valid relative or absolute URI. - The cancellation token was canceled. This exception is stored into the returned task. @@ -2593,7 +2754,9 @@ The size specified is greater than the maximum allowed buffer size. ]]> - The cancellation token was canceled. This exception is stored into the returned task. + The must be an absolute URI or must be set. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The cancellation token was canceled or the request failed due to timeout. @@ -2678,7 +2841,11 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -2739,7 +2906,11 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -2808,7 +2979,11 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. @@ -2875,7 +3050,11 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -2965,7 +3144,11 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -3026,7 +3209,11 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -3095,7 +3282,11 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. @@ -3162,7 +3353,11 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -3218,7 +3413,7 @@ The custom class derived from does The custom does not override the method. The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, or server certificate validation. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . If the exception nests the : The request failed due to timeout. @@ -3273,7 +3468,7 @@ The custom does not override The custom does not override the method. The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, or server certificate validation. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . If the exception nests the : The request failed due to timeout. @@ -3328,7 +3523,7 @@ The custom does not override The custom does not override the method. The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, or server certificate validation. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -3388,7 +3583,7 @@ The custom does not override The custom does not override the method. The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, or server certificate validation. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -3471,7 +3666,11 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -3533,7 +3732,11 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -3595,7 +3798,11 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -3663,7 +3870,11 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + +-or- + +.NET Framework only: the request timed out. The cancellation token was canceled. This exception is stored into the returned task. -or- diff --git a/xml/System.Net.Http/HttpResponseMessage.xml b/xml/System.Net.Http/HttpResponseMessage.xml index 3372a83505f..966e4714739 100644 --- a/xml/System.Net.Http/HttpResponseMessage.xml +++ b/xml/System.Net.Http/HttpResponseMessage.xml @@ -351,7 +351,8 @@ When the `disposing` parameter is `true`, this method releases all resources hel method throws an exception if the HTTP response was unsuccessful. In .NET Framework and .NET Core 2.2 and earlier versions, if the is not `null`, this method will also call to free managed and unmanaged resources. Starting with .NET Core 3.0, the content will not be disposed. + The method throws an if is outside of the range the range 200-299 (the range of status codes indicating success according to the standard). + In .NET Framework and .NET Core 2.2 and earlier versions, if the is not `null`, this method will also call to free managed and unmanaged resources. Starting with .NET Core 3.0, the content will not be disposed. ]]> From ea37af5e6c56292b1f5300730573bfaa57838558 Mon Sep 17 00:00:00 2001 From: antonfirsov Date: Mon, 17 Mar 2025 23:54:03 +0100 Subject: [PATCH 2/8] further notes for EnsureSuccessStatusCode --- xml/System.Net.Http/HttpResponseMessage.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xml/System.Net.Http/HttpResponseMessage.xml b/xml/System.Net.Http/HttpResponseMessage.xml index 966e4714739..ff18d690b85 100644 --- a/xml/System.Net.Http/HttpResponseMessage.xml +++ b/xml/System.Net.Http/HttpResponseMessage.xml @@ -352,8 +352,10 @@ When the `disposing` parameter is `true`, this method releases all resources hel ## Remarks The method throws an if is outside of the range the range 200-299 (the range of status codes indicating success according to the standard). + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. + In such cases we recommend to manually check if matches the expected value(s). In .NET Framework and .NET Core 2.2 and earlier versions, if the is not `null`, this method will also call to free managed and unmanaged resources. Starting with .NET Core 3.0, the content will not be disposed. - + ]]> The HTTP response is unsuccessful. From cfcfb272279d5bbc1689fe27b78bced2e062f920 Mon Sep 17 00:00:00 2001 From: antonfirsov Date: Mon, 17 Mar 2025 23:57:20 +0100 Subject: [PATCH 3/8] undo mess --- xml/System.Net.Http/HttpClient.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xml/System.Net.Http/HttpClient.xml b/xml/System.Net.Http/HttpClient.xml index 61908762a9e..3012aaf20f3 100644 --- a/xml/System.Net.Http/HttpClient.xml +++ b/xml/System.Net.Http/HttpClient.xml @@ -531,8 +531,8 @@ This property has no effect on any of the - - + + Method From b85887cb56b74603f8137a262120d8bd03c7fa1d Mon Sep 17 00:00:00 2001 From: antonfirsov Date: Tue, 18 Mar 2025 19:19:12 +0100 Subject: [PATCH 4/8] fix reference --- xml/System.Net.Http/HttpClient.xml | 86 +++++++++++++++--------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/xml/System.Net.Http/HttpClient.xml b/xml/System.Net.Http/HttpClient.xml index 3012aaf20f3..95c52b7a73c 100644 --- a/xml/System.Net.Http/HttpClient.xml +++ b/xml/System.Net.Http/HttpClient.xml @@ -600,7 +600,7 @@ The is not an absolute URI. -or- is not set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -677,7 +677,7 @@ The is not an absolute URI. -or- is not set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -760,7 +760,7 @@ The is not an absolute URI. -or- is not set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -843,7 +843,7 @@ The is not an absolute URI. -or- is not set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -990,7 +990,7 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -1059,7 +1059,7 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -1204,7 +1204,7 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -1279,7 +1279,7 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -1349,7 +1349,7 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - TThe request failed due to an issue getting an HTTP response such as network connectivity, DNS failure or server certificate validation. On .NET 8+ the reason is indicated by + TThe request failed due to an issue getting an HTTP response such as network connectivity, DNS failure or server certificate validation. On .NET 8+ the reason is indicated by -or- @@ -1429,7 +1429,7 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -1506,7 +1506,7 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -1604,7 +1604,7 @@ The is not an absolute URI. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -1681,7 +1681,7 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -1753,7 +1753,7 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -1822,7 +1822,7 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -1921,7 +1921,7 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -1997,7 +1997,7 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -2074,7 +2074,7 @@ the respose status code was outside of the range of 200-299 (status codes indica .NET Core and .NET 5 and later only: The request failed due to timeout. The is . - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -2138,7 +2138,7 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> The is . - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -2236,7 +2236,7 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -2312,7 +2312,7 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -2384,7 +2384,7 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> The is . - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -2453,7 +2453,7 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> The is . - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -2574,7 +2574,7 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -2631,7 +2631,7 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by The request failed due to timeout. @@ -2696,7 +2696,7 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by The cancellation token was canceled or the request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -2755,7 +2755,7 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by The cancellation token was canceled or the request failed due to timeout. @@ -2841,7 +2841,7 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -2906,7 +2906,7 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -2979,7 +2979,7 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -3050,7 +3050,7 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -3144,7 +3144,7 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -3209,7 +3209,7 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -3282,7 +3282,7 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -3353,7 +3353,7 @@ The size specified is greater than the maximum allowed buffer size. ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -3413,7 +3413,7 @@ The custom class derived from does The custom does not override the method. The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . If the exception nests the : The request failed due to timeout. @@ -3468,7 +3468,7 @@ The custom does not override The custom does not override the method. The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . If the exception nests the : The request failed due to timeout. @@ -3523,7 +3523,7 @@ The custom does not override The custom does not override the method. The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -3583,7 +3583,7 @@ The custom does not override The custom does not override the method. The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -3666,7 +3666,7 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -3732,7 +3732,7 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -3798,7 +3798,7 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- @@ -3870,7 +3870,7 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by -or- From e78a6672773d887ddccd215b0f4beae41b1b7755 Mon Sep 17 00:00:00 2001 From: antonfirsov Date: Tue, 18 Mar 2025 20:52:22 +0100 Subject: [PATCH 5/8] fix HttpResponseMessage.xml warning --- xml/System.Net.Http/HttpResponseMessage.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xml/System.Net.Http/HttpResponseMessage.xml b/xml/System.Net.Http/HttpResponseMessage.xml index ff18d690b85..6cf4cda19fb 100644 --- a/xml/System.Net.Http/HttpResponseMessage.xml +++ b/xml/System.Net.Http/HttpResponseMessage.xml @@ -351,9 +351,8 @@ When the `disposing` parameter is `true`, this method releases all resources hel method throws an if is outside of the range the range 200-299 (the range of status codes indicating success according to the standard). - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. - In such cases we recommend to manually check if matches the expected value(s). + The method throws an if is outside of the range the range 200-299 (the range of status codes indicating success according to the standard). + In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. In such cases we recommend to manually check if matches the expected value(s). In .NET Framework and .NET Core 2.2 and earlier versions, if the is not `null`, this method will also call to free managed and unmanaged resources. Starting with .NET Core 3.0, the content will not be disposed. ]]> From 060db12b08be7cf5d01753ab1fb78dcba4ec4f31 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Wed, 26 Mar 2025 19:26:10 +0100 Subject: [PATCH 6/8] Apply suggestions from code review Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- xml/System.Net.Http/HttpClient.xml | 14 +++++++------- xml/System.Net.Http/HttpResponseMessage.xml | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/xml/System.Net.Http/HttpClient.xml b/xml/System.Net.Http/HttpClient.xml index 95c52b7a73c..94e3ffbe519 100644 --- a/xml/System.Net.Http/HttpClient.xml +++ b/xml/System.Net.Http/HttpClient.xml @@ -600,11 +600,11 @@ The is not an absolute URI. -or- is not set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by . -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -1681,15 +1681,15 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8+, the reason is indicated by . -or- -the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) +The response status code was outside of the range of 200-299 (which indicate success according to the standard). -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -2573,8 +2573,8 @@ The size specified is greater than the maximum allowed buffer size. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8+, the reason is indicated by . The request failed due to timeout. The provided request URI is not valid relative or absolute URI. diff --git a/xml/System.Net.Http/HttpResponseMessage.xml b/xml/System.Net.Http/HttpResponseMessage.xml index 6cf4cda19fb..c4e5b30005d 100644 --- a/xml/System.Net.Http/HttpResponseMessage.xml +++ b/xml/System.Net.Http/HttpResponseMessage.xml @@ -351,9 +351,9 @@ When the `disposing` parameter is `true`, this method releases all resources hel method throws an if is outside of the range the range 200-299 (the range of status codes indicating success according to the standard). - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. In such cases we recommend to manually check if matches the expected value(s). - In .NET Framework and .NET Core 2.2 and earlier versions, if the is not `null`, this method will also call to free managed and unmanaged resources. Starting with .NET Core 3.0, the content will not be disposed. + The method throws an if is outside of the range 200-299 (the range of status codes indicating success according to the standard). + In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. + In .NET Framework and .NET Core 2.2 and earlier versions, if the is not `null`, this method also calls to free managed and unmanaged resources. Starting with .NET Core 3.0, the content is not disposed. ]]> From ac451bb22b5511d986889201fe0355f395aec276 Mon Sep 17 00:00:00 2001 From: antonfirsov Date: Wed, 9 Apr 2025 00:13:34 +0200 Subject: [PATCH 7/8] mass-apply suggestions at all locations --- xml/System.Net.Http/HttpClient.xml | 188 ++++++++++++++--------------- 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/xml/System.Net.Http/HttpClient.xml b/xml/System.Net.Http/HttpClient.xml index 94e3ffbe519..77d5606c8d4 100644 --- a/xml/System.Net.Http/HttpClient.xml +++ b/xml/System.Net.Http/HttpClient.xml @@ -677,7 +677,7 @@ The is not an absolute URI. -or- is not set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- @@ -760,7 +760,7 @@ The is not an absolute URI. -or- is not set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- @@ -843,7 +843,7 @@ The is not an absolute URI. -or- is not set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- @@ -989,8 +989,8 @@ The is not an absolute URI. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- @@ -1058,8 +1058,8 @@ The is not an absolute URI. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- @@ -1132,7 +1132,7 @@ The is not an absolute URI. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. + The is not an absolute URI and isn't set. The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. .NET Core and .NET 5 and later only: The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -1203,8 +1203,8 @@ The is not an absolute URI. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- @@ -1278,8 +1278,8 @@ The is not an absolute URI. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- @@ -1348,8 +1348,8 @@ The is not an absolute URI. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - TThe request failed due to an issue getting an HTTP response such as network connectivity, DNS failure or server certificate validation. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + TThe request failed due to an issue getting an HTTP response such as network connectivity, DNS failure or server certificate validation. On .NET 8 and later versions, the reason is indicated by -or- @@ -1428,8 +1428,8 @@ The is not an absolute URI. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- @@ -1505,8 +1505,8 @@ The is not an absolute URI. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- @@ -1603,16 +1603,16 @@ The is not an absolute URI. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) +The response status code was outside of the range of 200-299 (which indicate success according to the standard). -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -1680,8 +1680,8 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8+, the reason is indicated by . + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by . -or- @@ -1753,11 +1753,11 @@ The response status code was outside of the range of 200-299 (which indicate suc ]]> - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard). +The response status code was outside of the range of 200-299 (which indicate success according to the standard). The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. @@ -1822,11 +1822,11 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) +The response status code was outside of the range of 200-299 (which indicate success according to the standard). The cancellation token was canceled. This exception is stored into the returned task. @@ -1920,16 +1920,16 @@ the respose status code was outside of the range of 200-299 (status codes indica > - .NET 5 and later versions throw a that nests a . ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) +The response status code was outside of the range of 200-299 (which indicate success according to the standard). -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -1996,16 +1996,16 @@ the respose status code was outside of the range of 200-299 (status codes indica > - .NET 5 and later versions throw a that nests a . ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) +The response status code was outside of the range of 200-299 (which indicate success according to the standard). -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -2074,11 +2074,11 @@ the respose status code was outside of the range of 200-299 (status codes indica .NET Core and .NET 5 and later only: The request failed due to timeout. The is . - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard). +The response status code was outside of the range of 200-299 (which indicate success according to the standard). The provided request URI is not valid relative or absolute URI. @@ -2138,11 +2138,11 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> The is . - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard). +The response status code was outside of the range of 200-299 (which indicate success according to the standard). The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -2235,16 +2235,16 @@ the respose status code was outside of the range of 200-299 (status codes indica > - .NET 5 and later versions throw a that nests a . ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) +The response status code was outside of the range of 200-299 (which indicate success according to the standard). -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -2311,16 +2311,16 @@ the respose status code was outside of the range of 200-299 (status codes indica > - .NET 5 and later versions throw a that nests a . ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard) +The response status code was outside of the range of 200-299 (which indicate success according to the standard). -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -2384,11 +2384,11 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> The is . - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard). +The response status code was outside of the range of 200-299 (which indicate success according to the standard). The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. @@ -2453,11 +2453,11 @@ the respose status code was outside of the range of 200-299 (status codes indica ]]> The is . - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -the respose status code was outside of the range of 200-299 (status codes indicating success according to the standard). +The response status code was outside of the range of 200-299 (which indicate success according to the standard). The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -2574,7 +2574,7 @@ The size specified is greater than the maximum allowed buffer size. ]]> The is not an absolute URI and isn't set. - The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8+, the reason is indicated by . + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by . The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -2630,8 +2630,8 @@ The size specified is greater than the maximum allowed buffer size. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The request failed due to timeout. @@ -2695,8 +2695,8 @@ The size specified is greater than the maximum allowed buffer size. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The cancellation token was canceled or the request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -2754,8 +2754,8 @@ The size specified is greater than the maximum allowed buffer size. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by The cancellation token was canceled or the request failed due to timeout. @@ -2840,12 +2840,12 @@ The size specified is greater than the maximum allowed buffer size. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -2905,12 +2905,12 @@ The size specified is greater than the maximum allowed buffer size. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -2978,12 +2978,12 @@ The size specified is greater than the maximum allowed buffer size. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. @@ -3049,12 +3049,12 @@ The size specified is greater than the maximum allowed buffer size. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -3143,12 +3143,12 @@ The size specified is greater than the maximum allowed buffer size. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. The provided request URI is not valid relative or absolute URI. @@ -3208,12 +3208,12 @@ The size specified is greater than the maximum allowed buffer size. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -3281,12 +3281,12 @@ The size specified is greater than the maximum allowed buffer size. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. The provided request URI is not valid relative or absolute URI. The cancellation token was canceled. This exception is stored into the returned task. @@ -3352,12 +3352,12 @@ The size specified is greater than the maximum allowed buffer size. > - that nests a is thrown on .NET 5 and later versions. ]]> - The must be an absolute URI or must be set. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The is not an absolute URI and isn't set. + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -3413,7 +3413,7 @@ The custom class derived from does The custom does not override the method. The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by . If the exception nests the : The request failed due to timeout. @@ -3468,7 +3468,7 @@ The custom does not override The custom does not override the method. The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by . If the exception nests the : The request failed due to timeout. @@ -3523,7 +3523,7 @@ The custom does not override The custom does not override the method. The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by . The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -3583,7 +3583,7 @@ The custom does not override The custom does not override the method. The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by . + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by . The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -3666,11 +3666,11 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -3732,11 +3732,11 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. .NET Core and .NET 5 and later only: The request failed due to timeout. @@ -3798,11 +3798,11 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- -.NET Framework only: the request timed out. +.NET Framework only: The request timed out. The cancellation token was canceled. This exception is stored into the returned task. -or- @@ -3870,7 +3870,7 @@ This method stores in the task it returns all non-usage exceptions that the meth The is . The request message was already sent by the instance. - The request failed due to an issue getting a valid HTTP response such as network connectivity failure, DNS failure, server certificate validation error or invalid server response. On .NET 8+ the reason is indicated by + The request failed due to an issue getting a valid HTTP response, such as network connectivity failure, DNS failure, server certificate validation error, or invalid server response. On .NET 8 and later versions, the reason is indicated by -or- From 750581fb7e6d1fe89397e6e6d145b5782958fb74 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Wed, 9 Apr 2025 17:01:36 +0200 Subject: [PATCH 8/8] Apply suggestions from code review Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- xml/System.Net.Http/HttpClient.xml | 36 ++++++++++-------------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/xml/System.Net.Http/HttpClient.xml b/xml/System.Net.Http/HttpClient.xml index 77d5606c8d4..5dadd225300 100644 --- a/xml/System.Net.Http/HttpClient.xml +++ b/xml/System.Net.Http/HttpClient.xml @@ -1593,8 +1593,7 @@ The is not an absolute URI. ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. - In such cases we recommend to use the method and check if matches the expected value(s). +In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] > In case of timeout, different exceptions are thrown on different .NET implementations. @@ -1669,8 +1668,7 @@ The response status code was outside of the range of 200-299 (which indicate suc ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. - In such cases we recommend to use the method and check if matches the expected value(s). +In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] > In case of a timeout: @@ -1742,8 +1740,7 @@ The response status code was outside of the range of 200-299 (which indicate suc ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. - In such cases we recommend to use the method and check if matches the expected value(s). +In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] > In case of a timeout: @@ -1811,8 +1808,7 @@ The response status code was outside of the range of 200-299 (which indicate suc ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. - In such cases we recommend to use the method and check if matches the expected value(s). +In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] > In case of a timeout: @@ -1910,8 +1906,7 @@ The response status code was outside of the range of 200-299 (which indicate suc ## Remarks This operation doesn't block. The returned [Task\](xref:System.Threading.Tasks.Task%601) object will complete after the response headers are read. This method does not read or buffer the response body. Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. - In such cases we recommend to use the method and check if matches the expected value(s). +In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] > In case of a timeout: @@ -1986,8 +1981,7 @@ The response status code was outside of the range of 200-299 (which indicate suc ## Remarks This operation doesn't block. The returned [Task\](xref:System.Threading.Tasks.Task%601) object will complete after the response headers are read. This method does not read nor buffer the response body. Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. - In such cases we recommend to use the method and check if matches the expected value(s). +In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] > In case of a timeout: @@ -2058,8 +2052,7 @@ The response status code was outside of the range of 200-299 (which indicate suc ## Remarks This operation doesn't block. The returned [Task\](xref:System.Threading.Tasks.Task%601) object will complete after the response headers are read. This method does not read nor buffer the response body. Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. - In such cases we recommend to use the method and check if matches the expected value(s). +In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] > In case of a timeout: @@ -2127,8 +2120,7 @@ The response status code was outside of the range of 200-299 (which indicate suc ## Remarks This operation doesn't block. The returned [Task\](xref:System.Threading.Tasks.Task%601) object will complete after the response headers are read. This method does not read nor buffer the response body. Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. - In such cases we recommend to use the method and check if matches the expected value(s). +In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] > In case of a timeout: @@ -2225,8 +2217,7 @@ The response status code was outside of the range of 200-299 (which indicate suc ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. - In such cases we recommend to use the method and check if matches the expected value(s). +In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] > In case of a timeout: @@ -2301,8 +2292,7 @@ The response status code was outside of the range of 200-299 (which indicate suc ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. - In such cases we recommend to use the method and check if matches the expected value(s). +In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] > In case of a timeout: @@ -2373,8 +2363,7 @@ The response status code was outside of the range of 200-299 (which indicate suc ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. - In such cases we recommend to use the method and check if matches the expected value(s). +In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] > In case of a timeout: @@ -2442,8 +2431,7 @@ The response status code was outside of the range of 200-299 (which indicate suc ## Remarks This operation doesn't block. The returned object will complete after the whole response body is read. Internally, this operation uses to ensure the response status code is in the success range (200-299) and throws an if it is not. - In some scenarios you may need stronger control defining which status codes are considered to be succesful; for example an API may be expected to always return `200 OK`. - In such cases we recommend to use the method and check if matches the expected value(s). +In some scenarios, you might need more control over which status codes are considered to be successful; for example, an API might be expected to always return `200 OK`. In such cases, we recommend to manually check if matches the expected value. > [!NOTE] > In case of a timeout: