Property RequestTimeout
RequestTimeout
Gets how long a request can take before it is cancelled: from sending it until the response is read, or until the response starts for a streaming response or a request that returns the HttpResponseMessage itself. A request that times out throws a TaskCanceledException whose inner exception is a TimeoutException. A request can have a timeout of its own (see SetRequestTimeout(HttpRequestMessage, TimeSpan)). If a parent client exists, returns the parent's value by default; otherwise 100 seconds.
Declaration
protected virtual TimeSpan RequestTimeout { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Remarks
InfiniteTimeSpan and values longer than MaxValue milliseconds (about 24.8 days), such as MaxValue, mean no timeout. Requests throw an InvalidOperationException for zero, and for negative values other than InfiniteTimeSpan. Hub connections are not affected.