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
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2174,6 +2174,15 @@ public class GoodController : ApiController
2174
2174
2175
2175
The same timeout will apply for all requests using this <xref:System.Net.Http.HttpClient> instance. You may also set different timeouts for individual requests using a <xref:System.Threading.CancellationTokenSource> on a task. Note that only the shorter of the two timeouts will apply.
2176
2176
2177
+
## Example
2178
+
2179
+
The following example sets the `Timeout` property.
2180
+
2181
+
```csharp
2182
+
HttpClient httpClient = new HttpClient();
2183
+
httpClient.Timeout = TimeSpan.FromMinutes(10);
2184
+
```
2185
+
2177
2186
]]></format>
2178
2187
</remarks>
2179
2188
<exceptioncref="T:System.ArgumentOutOfRangeException">The timeout specified is less than or equal to zero and is not <seecref="F:System.Threading.Timeout.InfiniteTimeSpan" />.</exception>
0 commit comments