From 2ef53c41695ae13b43d08ab97f9fb1a1810e256b Mon Sep 17 00:00:00 2001 From: Scott Offen <3513626+scottoffen@users.noreply.github.com> Date: Fri, 28 Nov 2025 22:18:37 -0700 Subject: [PATCH] Update Timeout documentation --- docs/docs/configure-timeout.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/docs/configure-timeout.md b/docs/docs/configure-timeout.md index e620f76..8e64c98 100644 --- a/docs/docs/configure-timeout.md +++ b/docs/docs/configure-timeout.md @@ -29,6 +29,19 @@ var response = await client Timeouts link with any caller-provided `CancellationToken`; whichever triggers first will cancel the request. +### Clear Timeouts + +Any timeouts that have been set can be clearing using `ClearTimeout`. This is most useful when the `HttpRequestBuilder` is being reused. + +```csharp +var builder = client + .UsingBase() + .WithRoute("/todos/1") + .WithTimeout(TimeSpan.FromMilliseconds(750)); + +builder.ClearTimeout(); +``` + ## Behavior Notes * 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 | Method | Purpose | | ----------------------- | ------------------------------------------------- | +| `ClearTimeout()` | Removes any per-request timeout. | | `WithTimeout(int)` | Applies a per-request timeout using seconds. | | `WithTimeout(TimeSpan)` | Applies a per-request timeout using a `TimeSpan`. |