Skip to content

Commit 2643c35

Browse files
authored
Update Timeout Documentation (#48)
1 parent d241602 commit 2643c35

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

docs/docs/configure-timeout.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ var response = await client
2929

3030
Timeouts link with any caller-provided `CancellationToken`; whichever triggers first will cancel the request.
3131

32+
### Clear Timeouts
33+
34+
Any timeouts that have been set can be clearing using `ClearTimeout`. This is most useful when the `HttpRequestBuilder` is being reused.
35+
36+
```csharp
37+
var builder = client
38+
.UsingBase()
39+
.WithRoute("/todos/1")
40+
.WithTimeout(TimeSpan.FromMilliseconds(750));
41+
42+
builder.ClearTimeout();
43+
```
44+
3245
## Behavior Notes
3346

3447
* The timeout applies only to the current request and does not affect any other requests sent using the same `HttpClient` instance.
@@ -40,5 +53,6 @@ Timeouts link with any caller-provided `CancellationToken`; whichever triggers f
4053

4154
| Method | Purpose |
4255
| ----------------------- | ------------------------------------------------- |
56+
| `ClearTimeout()` | Removes any per-request timeout. |
4357
| `WithTimeout(int)` | Applies a per-request timeout using seconds. |
4458
| `WithTimeout(TimeSpan)` | Applies a per-request timeout using a `TimeSpan`. |

0 commit comments

Comments
 (0)