@@ -9,17 +9,70 @@ import { type HeadersLike } from './headers';
99export type FinalRequestOptions = RequestOptions & { method : HTTPMethod ; path : string } ;
1010
1111export type RequestOptions = {
12+ /**
13+ * The HTTP method for the request (e.g., 'get', 'post', 'put', 'delete').
14+ */
1215 method ?: HTTPMethod ;
16+
17+ /**
18+ * The URL path for the request.
19+ *
20+ * @example "/v1/foo"
21+ */
1322 path ?: string ;
23+
24+ /**
25+ * Query parameters to include in the request URL.
26+ */
1427 query ?: object | undefined | null ;
28+
29+ /**
30+ * The request body. Can be a string, JSON object, FormData, or other supported types.
31+ */
1532 body ?: unknown ;
33+
34+ /**
35+ * HTTP headers to include with the request. Can be a Headers object, plain object, or array of tuples.
36+ */
1637 headers ?: HeadersLike ;
38+
39+ /**
40+ * The maximum number of times that the client will retry a request in case of a
41+ * temporary failure, like a network error or a 5XX error from the server.
42+ *
43+ * @default 2
44+ */
1745 maxRetries ?: number ;
46+
1847 stream ?: boolean | undefined ;
48+
49+ /**
50+ * The maximum amount of time (in milliseconds) that the client should wait for a response
51+ * from the server before timing out a single request.
52+ *
53+ * @unit milliseconds
54+ */
1955 timeout ?: number ;
56+
57+ /**
58+ * Additional `RequestInit` options to be passed to the underlying `fetch` call.
59+ * These options will be merged with the client's default fetch options.
60+ */
2061 fetchOptions ?: MergedRequestInit ;
62+
63+ /**
64+ * An AbortSignal that can be used to cancel the request.
65+ */
2166 signal ?: AbortSignal | undefined | null ;
67+
68+ /**
69+ * A unique key for this request to enable idempotency.
70+ */
2271 idempotencyKey ?: string ;
72+
73+ /**
74+ * Override the default base URL for this specific request.
75+ */
2376 defaultBaseURL ?: string | undefined ;
2477
2578 __binaryResponse ?: boolean | undefined ;
0 commit comments