You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: xml/System.Net.Http/HttpClient.xml
+12-24
Original file line number
Diff line number
Diff line change
@@ -1593,8 +1593,7 @@ The <paramref name="requestUri" /> is not an absolute URI.
1593
1593
## Remarks
1594
1594
This operation doesn't block. The returned <xref:System.Threading.Tasks.Task%601> object will complete after the whole response body is read.
1595
1595
Internally, this operation uses <xref:System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode%2A?displayProperty=nameWithType> to ensure the response status code is in the success range (200-299) and throws an <xref:System.Net.Http.HttpRequestException> if it is not.
1596
-
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`.
1597
-
In such cases we recommend to use the <xref:System.Net.Http.HttpClient.SendAsync%2A> method and check if <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> matches the expected value(s).
1596
+
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 <xref:System.Net.Http.HttpResponseMessage.StatusCode> matches the expected value.
1598
1597
1599
1598
> [!NOTE]
1600
1599
> 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
1669
1668
## Remarks
1670
1669
This operation doesn't block. The returned <xref:System.Threading.Tasks.Task%601> object will complete after the whole response body is read.
1671
1670
Internally, this operation uses <xref:System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode%2A?displayProperty=nameWithType> to ensure the response status code is in the success range (200-299) and throws an <xref:System.Net.Http.HttpRequestException> if it is not.
1672
-
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`.
1673
-
In such cases we recommend to use the <xref:System.Net.Http.HttpClient.SendAsync%2A> method and check if <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> matches the expected value(s).
1671
+
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 <xref:System.Net.Http.HttpResponseMessage.StatusCode> matches the expected value.
1674
1672
1675
1673
> [!NOTE]
1676
1674
> In case of a timeout:
@@ -1742,8 +1740,7 @@ The response status code was outside of the range of 200-299 (which indicate suc
1742
1740
## Remarks
1743
1741
This operation doesn't block. The returned <xref:System.Threading.Tasks.Task%601> object will complete after the whole response body is read.
1744
1742
Internally, this operation uses <xref:System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode%2A?displayProperty=nameWithType> to ensure the response status code is in the success range (200-299) and throws an <xref:System.Net.Http.HttpRequestException> if it is not.
1745
-
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`.
1746
-
In such cases we recommend to use the <xref:System.Net.Http.HttpClient.SendAsync%2A> method and check if <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> matches the expected value(s).
1743
+
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 <xref:System.Net.Http.HttpResponseMessage.StatusCode> matches the expected value.
1747
1744
1748
1745
> [!NOTE]
1749
1746
> In case of a timeout:
@@ -1811,8 +1808,7 @@ The response status code was outside of the range of 200-299 (which indicate suc
1811
1808
## Remarks
1812
1809
This operation doesn't block. The returned <xref:System.Threading.Tasks.Task%601> object will complete after the whole response body is read.
1813
1810
Internally, this operation uses <xref:System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode%2A?displayProperty=nameWithType> to ensure the response status code is in the success range (200-299) and throws an <xref:System.Net.Http.HttpRequestException> if it is not.
1814
-
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`.
1815
-
In such cases we recommend to use the <xref:System.Net.Http.HttpClient.SendAsync%2A> method and check if <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> matches the expected value(s).
1811
+
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 <xref:System.Net.Http.HttpResponseMessage.StatusCode> matches the expected value.
1816
1812
1817
1813
> [!NOTE]
1818
1814
> In case of a timeout:
@@ -1910,8 +1906,7 @@ The response status code was outside of the range of 200-299 (which indicate suc
1910
1906
## Remarks
1911
1907
This operation doesn't block. The returned [Task\<Stream>](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.
1912
1908
Internally, this operation uses <xref:System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode%2A?displayProperty=nameWithType> to ensure the response status code is in the success range (200-299) and throws an <xref:System.Net.Http.HttpRequestException> if it is not.
1913
-
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`.
1914
-
In such cases we recommend to use the <xref:System.Net.Http.HttpClient.SendAsync%2A> method and check if <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> matches the expected value(s).
1909
+
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 <xref:System.Net.Http.HttpResponseMessage.StatusCode> matches the expected value.
1915
1910
1916
1911
> [!NOTE]
1917
1912
> In case of a timeout:
@@ -1986,8 +1981,7 @@ The response status code was outside of the range of 200-299 (which indicate suc
1986
1981
## Remarks
1987
1982
This operation doesn't block. The returned [Task\<Stream>](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.
1988
1983
Internally, this operation uses <xref:System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode%2A?displayProperty=nameWithType> to ensure the response status code is in the success range (200-299) and throws an <xref:System.Net.Http.HttpRequestException> if it is not.
1989
-
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`.
1990
-
In such cases we recommend to use the <xref:System.Net.Http.HttpClient.SendAsync%2A> method and check if <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> matches the expected value(s).
1984
+
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 <xref:System.Net.Http.HttpResponseMessage.StatusCode> matches the expected value.
1991
1985
1992
1986
> [!NOTE]
1993
1987
> In case of a timeout:
@@ -2058,8 +2052,7 @@ The response status code was outside of the range of 200-299 (which indicate suc
2058
2052
## Remarks
2059
2053
This operation doesn't block. The returned [Task\<Stream>](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.
2060
2054
Internally, this operation uses <xref:System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode%2A?displayProperty=nameWithType> to ensure the response status code is in the success range (200-299) and throws an <xref:System.Net.Http.HttpRequestException> if it is not.
2061
-
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`.
2062
-
In such cases we recommend to use the <xref:System.Net.Http.HttpClient.SendAsync%2A> method and check if <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> matches the expected value(s).
2055
+
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 <xref:System.Net.Http.HttpResponseMessage.StatusCode> matches the expected value.
2063
2056
2064
2057
> [!NOTE]
2065
2058
> In case of a timeout:
@@ -2127,8 +2120,7 @@ The response status code was outside of the range of 200-299 (which indicate suc
2127
2120
## Remarks
2128
2121
This operation doesn't block. The returned [Task\<Stream>](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.
2129
2122
Internally, this operation uses <xref:System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode%2A?displayProperty=nameWithType> to ensure the response status code is in the success range (200-299) and throws an <xref:System.Net.Http.HttpRequestException> if it is not.
2130
-
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`.
2131
-
In such cases we recommend to use the <xref:System.Net.Http.HttpClient.SendAsync%2A> method and check if <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> matches the expected value(s).
2123
+
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 <xref:System.Net.Http.HttpResponseMessage.StatusCode> matches the expected value.
2132
2124
2133
2125
> [!NOTE]
2134
2126
> In case of a timeout:
@@ -2225,8 +2217,7 @@ The response status code was outside of the range of 200-299 (which indicate suc
2225
2217
## Remarks
2226
2218
This operation doesn't block. The returned <xref:System.Threading.Tasks.Task%601> object will complete after the whole response body is read.
2227
2219
Internally, this operation uses <xref:System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode%2A?displayProperty=nameWithType> to ensure the response status code is in the success range (200-299) and throws an <xref:System.Net.Http.HttpRequestException> if it is not.
2228
-
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`.
2229
-
In such cases we recommend to use the <xref:System.Net.Http.HttpClient.SendAsync%2A> method and check if <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> matches the expected value(s).
2220
+
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 <xref:System.Net.Http.HttpResponseMessage.StatusCode> matches the expected value.
2230
2221
2231
2222
> [!NOTE]
2232
2223
> In case of a timeout:
@@ -2301,8 +2292,7 @@ The response status code was outside of the range of 200-299 (which indicate suc
2301
2292
## Remarks
2302
2293
This operation doesn't block. The returned <xref:System.Threading.Tasks.Task%601> object will complete after the whole response body is read.
2303
2294
Internally, this operation uses <xref:System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode%2A?displayProperty=nameWithType> to ensure the response status code is in the success range (200-299) and throws an <xref:System.Net.Http.HttpRequestException> if it is not.
2304
-
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`.
2305
-
In such cases we recommend to use the <xref:System.Net.Http.HttpClient.SendAsync%2A> method and check if <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> matches the expected value(s).
2295
+
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 <xref:System.Net.Http.HttpResponseMessage.StatusCode> matches the expected value.
2306
2296
2307
2297
> [!NOTE]
2308
2298
> In case of a timeout:
@@ -2373,8 +2363,7 @@ The response status code was outside of the range of 200-299 (which indicate suc
2373
2363
## Remarks
2374
2364
This operation doesn't block. The returned <xref:System.Threading.Tasks.Task%601> object will complete after the whole response body is read.
2375
2365
Internally, this operation uses <xref:System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode%2A?displayProperty=nameWithType> to ensure the response status code is in the success range (200-299) and throws an <xref:System.Net.Http.HttpRequestException> if it is not.
2376
-
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`.
2377
-
In such cases we recommend to use the <xref:System.Net.Http.HttpClient.SendAsync%2A> method and check if <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> matches the expected value(s).
2366
+
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 <xref:System.Net.Http.HttpResponseMessage.StatusCode> matches the expected value.
2378
2367
2379
2368
> [!NOTE]
2380
2369
> In case of a timeout:
@@ -2442,8 +2431,7 @@ The response status code was outside of the range of 200-299 (which indicate suc
2442
2431
## Remarks
2443
2432
This operation doesn't block. The returned <xref:System.Threading.Tasks.Task%601> object will complete after the whole response body is read.
2444
2433
Internally, this operation uses <xref:System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode%2A?displayProperty=nameWithType> to ensure the response status code is in the success range (200-299) and throws an <xref:System.Net.Http.HttpRequestException> if it is not.
2445
-
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`.
2446
-
In such cases we recommend to use the <xref:System.Net.Http.HttpClient.SendAsync%2A> method and check if <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> matches the expected value(s).
2434
+
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 <xref:System.Net.Http.HttpResponseMessage.StatusCode> matches the expected value.
0 commit comments