Interface RequestOptions<TOpaque>
interface RequestOptions<TOpaque = null> {
blocking?: boolean;
body?:
| string
| Readable
| Uint8Array<ArrayBufferLike>
| Buffer<ArrayBufferLike>
| FormData
| null;
bodyTimeout?: number | null;
expectContinue?: boolean;
headers?: UndiciHeaders;
headersTimeout?: number | null;
highWaterMark?: number;
idempotent?: boolean;
method: HttpMethod;
onInfo?: (
info: {
headers: Record<string, string | string[]>;
statusCode: number;
},
) => void;
opaque?: TOpaque;
origin?: string
| URL;
path: string;
query?: Record<string, any>;
reset?: boolean;
responseHeaders?: "raw" | null;
signal?: unknown;
throwOnError?: boolean;
typeOfService?: number | null;
upgrade?: string | boolean | null;
}Properties§
blocking?: booleanbody?:
| string
| Readable
| Uint8Array<ArrayBufferLike>
| Buffer<ArrayBufferLike>
| FormData
| nullDefault: null
body Timeout?: number | nullThe timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use 0 to disable it entirely. Defaults to 300 seconds.
expect Continue?: booleanFor H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server
headers?: UndiciHeadersDefault: null
headers Timeout?: number | nullThe amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds.
high Water Mark?: numberDefault: 64 KiB
idempotent?: booleanWhether the requests can be safely retried or not. If false the request won't be sent until all preceding requests in the pipeline have completed. Default: true if method is HEAD or GET.
method: HttpMethod§on Info?: { ... }Default: null
opaque?: TOpaqueDefault: null
origin?: string | URL§path: string§query?: Record<string, any>Query string params to be embedded in the request URL. Default: null
reset?: booleanWhether the request should stablish a keep-alive or not. Default false
response Headers?: "raw" | nullDefault: null
signal?: unknownDefault: null
throw On Error?: booleanWhether Undici should throw an error upon receiving a 4xx or 5xx response from the server. Defaults to false
type Of Service?: number | nullThe IP Type of Service (ToS) value for the request socket. Must be an integer between 0 and 255. Default: 0
upgrade?: string | boolean | nullUpgrade the request. Should be used to specify the kind of upgrade i.e. 'Websocket'. Default: method === 'CONNECT' || null.
Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to
truefurther pipelining will be avoided on the same connection until headers have been received. Defaults tomethod !== 'HEAD'.