index/functions/requestWithTimeout.md
requestWithTimeout(
requestor,url,options,timeoutMs,kind?):Promise<HTTPResponse>
Sends one request through requestor, aborting it after timeoutMs (REQUEST_TIMEOUT). The
caller's own abort passes through as it is. kind: { write: false } marks a read: its
REQUEST_TIMEOUT, and a TRANSPORT_ERROR of the default requestors (which cannot tell a read
from a write), then say write: false. Without it they are judged as a write's (fail-closed),
which is what a write's transport needs before it decides what an unanswered write means.
timeout ms http response request transport error
Parameters
| Parameter | Type |
|---|---|
requestor | HttpRequestor |
url | string |
options | RequestInit |
timeoutMs | number |
kind? | RequestKind |
http requestor request init timeout ms kind
Returns
Promise<HTTPResponse>
http response