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