6
6
7
7
# Function: fetchT()
8
8
9
+ Fetches a resource from the network and returns either a ` FetchTask ` or ` FetchResponse ` based on the provided options.
10
+
11
+ ## Type Param
12
+
13
+ The expected type of the response data when not using a specific ` responseType ` .
14
+
15
+ ## Param
16
+
17
+ The resource to fetch. Can be a URL object or a string representing a URL.
18
+
19
+ ## Param
20
+
21
+ Additional options for the fetch operation, including custom ` FetchInit ` properties.
22
+
9
23
## fetchT(url, init)
10
24
11
25
``` ts
@@ -17,7 +31,7 @@ Fetches a resource from the network as a text string and returns a `FetchTask` r
17
31
### Parameters
18
32
19
33
| Parameter | Type | Description |
20
- | : ------ | : ------ | : ------ |
34
+ | ------ | ------ | ------ |
21
35
| ` url ` | ` string ` \| ` URL ` | The resource to fetch . Can be a URL object or a string representing a URL . |
22
36
| ` init ` | [` FetchInit ` ](../ interfaces / FetchInit .md ) & \{ ` abortable ` : ` true ` ; ` responseType ` : ` "text" ` ; \} | Additional options for the fetch operation , including custom ` FetchInit ` properties . |
23
37
@@ -27,9 +41,9 @@ Fetches a resource from the network as a text string and returns a `FetchTask` r
27
41
28
42
A ` FetchTask ` representing the operation with a ` string ` response .
29
43
30
- ### Source
44
+ ### Defined in
31
45
32
- [src / fetch / fetch .ts :14 ](https :// github.com/JiangJie/fetch-t/blob/6a5239d36df6ec2fbc78b194fa1370d9bdc8caa2 /src/fetch/fetch.ts#L14)
46
+ [src / fetch / fetch .ts :14 ](https :// github.com/JiangJie/fetch-t/blob/9e5c4ce034f7bf6add07f55044bccbb16a68960c /src/fetch/fetch.ts#L14)
33
47
34
48
## fetchT (url , init )
35
49
@@ -42,7 +56,7 @@ Fetches a resource from the network as an ArrayBuffer and returns a `FetchTask`
42
56
### Parameters
43
57
44
58
| Parameter | Type | Description |
45
- | : ------ | : ------ | : ------ |
59
+ | ------ | ------ | ------ |
46
60
| ` url ` | ` string ` \| ` URL ` | The resource to fetch . Can be a URL object or a string representing a URL . |
47
61
| ` init ` | [` FetchInit ` ](../ interfaces / FetchInit .md ) & \{ ` abortable ` : ` true ` ; ` responseType ` : ` "arraybuffer" ` ; \} | Additional options for the fetch operation , including custom ` FetchInit ` properties . |
48
62
@@ -52,9 +66,9 @@ Fetches a resource from the network as an ArrayBuffer and returns a `FetchTask`
52
66
53
67
A ` FetchTask ` representing the operation with an ` ArrayBuffer ` response .
54
68
55
- ### Source
69
+ ### Defined in
56
70
57
- [src / fetch / fetch .ts :26 ](https :// github.com/JiangJie/fetch-t/blob/6a5239d36df6ec2fbc78b194fa1370d9bdc8caa2 /src/fetch/fetch.ts#L26)
71
+ [src / fetch / fetch .ts :26 ](https :// github.com/JiangJie/fetch-t/blob/9e5c4ce034f7bf6add07f55044bccbb16a68960c /src/fetch/fetch.ts#L26)
58
72
59
73
## fetchT (url , init )
60
74
@@ -67,7 +81,7 @@ Fetches a resource from the network as a Blob and returns a `FetchTask` represen
67
81
### Parameters
68
82
69
83
| Parameter | Type | Description |
70
- | : ------ | : ------ | : ------ |
84
+ | ------ | ------ | ------ |
71
85
| ` url ` | ` string ` \| ` URL ` | The resource to fetch . Can be a URL object or a string representing a URL . |
72
86
| ` init ` | [` FetchInit ` ](../ interfaces / FetchInit .md ) & \{ ` abortable ` : ` true ` ; ` responseType ` : ` "blob" ` ; \} | Additional options for the fetch operation , including custom ` FetchInit ` properties . |
73
87
@@ -77,9 +91,9 @@ Fetches a resource from the network as a Blob and returns a `FetchTask` represen
77
91
78
92
A ` FetchTask ` representing the operation with a ` Blob ` response .
79
93
80
- ### Source
94
+ ### Defined in
81
95
82
- [src / fetch / fetch .ts :38 ](https :// github.com/JiangJie/fetch-t/blob/6a5239d36df6ec2fbc78b194fa1370d9bdc8caa2 /src/fetch/fetch.ts#L38)
96
+ [src / fetch / fetch .ts :38 ](https :// github.com/JiangJie/fetch-t/blob/9e5c4ce034f7bf6add07f55044bccbb16a68960c /src/fetch/fetch.ts#L38)
83
97
84
98
## fetchT (url , init )
85
99
@@ -89,16 +103,16 @@ function fetchT<T>(url, init): FetchTask<T>
89
103
90
104
Fetches a resource from the network and parses it as JSON , returning a ` FetchTask ` representing the operation .
91
105
92
- ### Type parameters
106
+ ### Type Parameters
93
107
94
- | Type parameter | Description |
95
- | : ------ | : ------ |
108
+ | Type Parameter | Description |
109
+ | ------ | ------ |
96
110
| ` T ` | The expected type of the parsed JSON data . |
97
111
98
112
### Parameters
99
113
100
114
| Parameter | Type | Description |
101
- | : ------ | : ------ | : ------ |
115
+ | ------ | ------ | ------ |
102
116
| ` url ` | ` string ` \| ` URL ` | The resource to fetch . Can be a URL object or a string representing a URL . |
103
117
| ` init ` | [` FetchInit ` ](../ interfaces / FetchInit .md ) & \{ ` abortable ` : ` true ` ; ` responseType ` : ` "json" ` ; \} | Additional options for the fetch operation , including custom ` FetchInit ` properties . |
104
118
@@ -108,9 +122,9 @@ Fetches a resource from the network and parses it as JSON, returning a `FetchTas
108
122
109
123
A ` FetchTask ` representing the operation with a response parsed as JSON .
110
124
111
- ### Source
125
+ ### Defined in
112
126
113
- [src / fetch / fetch .ts :51 ](https :// github.com/JiangJie/fetch-t/blob/6a5239d36df6ec2fbc78b194fa1370d9bdc8caa2 /src/fetch/fetch.ts#L51)
127
+ [src / fetch / fetch .ts :51 ](https :// github.com/JiangJie/fetch-t/blob/9e5c4ce034f7bf6add07f55044bccbb16a68960c /src/fetch/fetch.ts#L51)
114
128
115
129
## fetchT (url , init )
116
130
@@ -123,7 +137,7 @@ Fetches a resource from the network as a text string and returns a `FetchRespons
123
137
### Parameters
124
138
125
139
| Parameter | Type | Description |
126
- | : ------ | : ------ | : ------ |
140
+ | ------ | ------ | ------ |
127
141
| ` url ` | ` string ` \| ` URL ` | The resource to fetch . Can be a URL object or a string representing a URL . |
128
142
| ` init ` | [` FetchInit ` ](../ interfaces / FetchInit .md ) & \{ ` responseType ` : ` "text" ` ; \} | Additional options for the fetch operation , specifying the response type as ' text' . |
129
143
@@ -133,9 +147,9 @@ Fetches a resource from the network as a text string and returns a `FetchRespons
133
147
134
148
A ` FetchResponse ` representing the operation with a ` string ` response .
135
149
136
- ### Source
150
+ ### Defined in
137
151
138
- [src / fetch / fetch .ts :63 ](https :// github.com/JiangJie/fetch-t/blob/6a5239d36df6ec2fbc78b194fa1370d9bdc8caa2 /src/fetch/fetch.ts#L63)
152
+ [src / fetch / fetch .ts :63 ](https :// github.com/JiangJie/fetch-t/blob/9e5c4ce034f7bf6add07f55044bccbb16a68960c /src/fetch/fetch.ts#L63)
139
153
140
154
## fetchT (url , init )
141
155
@@ -148,7 +162,7 @@ Fetches a resource from the network as an ArrayBuffer and returns a `FetchRespon
148
162
### Parameters
149
163
150
164
| Parameter | Type | Description |
151
- | : ------ | : ------ | : ------ |
165
+ | ------ | ------ | ------ |
152
166
| ` url ` | ` string ` \| ` URL ` | The resource to fetch . Can be a URL object or a string representing a URL . |
153
167
| ` init ` | [` FetchInit ` ](../ interfaces / FetchInit .md ) & \{ ` responseType ` : ` "arraybuffer" ` ; \} | Additional options for the fetch operation , specifying the response type as ' arraybuffer' . |
154
168
@@ -158,9 +172,9 @@ Fetches a resource from the network as an ArrayBuffer and returns a `FetchRespon
158
172
159
173
A ` FetchResponse ` representing the operation with an ` ArrayBuffer ` response .
160
174
161
- ### Source
175
+ ### Defined in
162
176
163
- [src / fetch / fetch .ts :74 ](https :// github.com/JiangJie/fetch-t/blob/6a5239d36df6ec2fbc78b194fa1370d9bdc8caa2 /src/fetch/fetch.ts#L74)
177
+ [src / fetch / fetch .ts :74 ](https :// github.com/JiangJie/fetch-t/blob/9e5c4ce034f7bf6add07f55044bccbb16a68960c /src/fetch/fetch.ts#L74)
164
178
165
179
## fetchT (url , init )
166
180
@@ -173,7 +187,7 @@ Fetches a resource from the network as a Blob and returns a `FetchResponse` repr
173
187
### Parameters
174
188
175
189
| Parameter | Type | Description |
176
- | : ------ | : ------ | : ------ |
190
+ | ------ | ------ | ------ |
177
191
| ` url ` | ` string ` \| ` URL ` | The resource to fetch . Can be a URL object or a string representing a URL . |
178
192
| ` init ` | [` FetchInit ` ](../ interfaces / FetchInit .md ) & \{ ` responseType ` : ` "blob" ` ; \} | Additional options for the fetch operation , specifying the response type as ' blob' . |
179
193
@@ -183,9 +197,9 @@ Fetches a resource from the network as a Blob and returns a `FetchResponse` repr
183
197
184
198
A ` FetchResponse ` representing the operation with a ` Blob ` response .
185
199
186
- ### Source
200
+ ### Defined in
187
201
188
- [src / fetch / fetch .ts :85 ](https :// github.com/JiangJie/fetch-t/blob/6a5239d36df6ec2fbc78b194fa1370d9bdc8caa2 /src/fetch/fetch.ts#L85)
202
+ [src / fetch / fetch .ts :85 ](https :// github.com/JiangJie/fetch-t/blob/9e5c4ce034f7bf6add07f55044bccbb16a68960c /src/fetch/fetch.ts#L85)
189
203
190
204
## fetchT (url , init )
191
205
@@ -195,16 +209,16 @@ function fetchT<T>(url, init): FetchResponse<T>
195
209
196
210
Fetches a resource from the network and parses it as JSON , returning a ` FetchResponse ` representing the operation .
197
211
198
- ### Type parameters
212
+ ### Type Parameters
199
213
200
- | Type parameter | Description |
201
- | : ------ | : ------ |
214
+ | Type Parameter | Description |
215
+ | ------ | ------ |
202
216
| ` T ` | The expected type of the parsed JSON data . |
203
217
204
218
### Parameters
205
219
206
220
| Parameter | Type | Description |
207
- | : ------ | : ------ | : ------ |
221
+ | ------ | ------ | ------ |
208
222
| ` url ` | ` string ` \| ` URL ` | The resource to fetch . Can be a URL object or a string representing a URL . |
209
223
| ` init ` | [` FetchInit ` ](../ interfaces / FetchInit .md ) & \{ ` responseType ` : ` "json" ` ; \} | Additional options for the fetch operation , specifying the response type as ' json' . |
210
224
@@ -214,9 +228,9 @@ Fetches a resource from the network and parses it as JSON, returning a `FetchRes
214
228
215
229
A ` FetchResponse ` representing the operation with a response parsed as JSON .
216
230
217
- ### Source
231
+ ### Defined in
218
232
219
- [src / fetch / fetch .ts :97 ](https :// github.com/JiangJie/fetch-t/blob/6a5239d36df6ec2fbc78b194fa1370d9bdc8caa2 /src/fetch/fetch.ts#L97)
233
+ [src / fetch / fetch .ts :97 ](https :// github.com/JiangJie/fetch-t/blob/9e5c4ce034f7bf6add07f55044bccbb16a68960c /src/fetch/fetch.ts#L97)
220
234
221
235
## fetchT (url , init )
222
236
@@ -229,7 +243,7 @@ Fetches a resource from the network and returns a `FetchTask` representing the o
229
243
### Parameters
230
244
231
245
| Parameter | Type | Description |
232
- | : ------ | : ------ | : ------ |
246
+ | ------ | ------ | ------ |
233
247
| ` url ` | ` string ` \| ` URL ` | The resource to fetch . Can be a URL object or a string representing a URL . |
234
248
| ` init ` | [` FetchInit ` ](../ interfaces / FetchInit .md ) & \{ ` abortable ` : ` true ` ; \} | Additional options for the fetch operation , indicating that the operation should be abortable . |
235
249
@@ -239,9 +253,9 @@ Fetches a resource from the network and returns a `FetchTask` representing the o
239
253
240
254
A ` FetchTask ` representing the operation with a generic ` Response ` .
241
255
242
- ### Source
256
+ ### Defined in
243
257
244
- [src / fetch / fetch .ts :108 ](https :// github.com/JiangJie/fetch-t/blob/6a5239d36df6ec2fbc78b194fa1370d9bdc8caa2 /src/fetch/fetch.ts#L108)
258
+ [src / fetch / fetch .ts :108 ](https :// github.com/JiangJie/fetch-t/blob/9e5c4ce034f7bf6add07f55044bccbb16a68960c /src/fetch/fetch.ts#L108)
245
259
246
260
## fetchT (url , init )
247
261
@@ -254,7 +268,7 @@ Fetches a resource from the network and returns a `FetchResponse` representing t
254
268
### Parameters
255
269
256
270
| Parameter | Type | Description |
257
- | : ------ | : ------ | : ------ |
271
+ | ------ | ------ | ------ |
258
272
| ` url ` | ` string ` \| ` URL ` | The resource to fetch . Can be a URL object or a string representing a URL . |
259
273
| ` init ` | [` FetchInit ` ](../ interfaces / FetchInit .md ) & \{ ` abortable ` : ` false ` ; \} | Additional options for the fetch operation , indicating that the operation should not be abortable . |
260
274
@@ -264,9 +278,9 @@ Fetches a resource from the network and returns a `FetchResponse` representing t
264
278
265
279
A ` FetchResponse ` representing the operation with a generic ` Response ` .
266
280
267
- ### Source
281
+ ### Defined in
268
282
269
- [src / fetch / fetch .ts :119 ](https :// github.com/JiangJie/fetch-t/blob/6a5239d36df6ec2fbc78b194fa1370d9bdc8caa2 /src/fetch/fetch.ts#L119)
283
+ [src / fetch / fetch .ts :119 ](https :// github.com/JiangJie/fetch-t/blob/9e5c4ce034f7bf6add07f55044bccbb16a68960c /src/fetch/fetch.ts#L119)
270
284
271
285
## fetchT (url , init )
272
286
@@ -276,16 +290,16 @@ function fetchT<T>(url, init): FetchTask<T> | FetchResponse<T>
276
290
277
291
Fetches a resource from the network and returns a ` FetchResponse ` or ` FetchTask ` based on the provided options .
278
292
279
- ### Type parameters
293
+ ### Type Parameters
280
294
281
- | Type parameter | Description |
282
- | : ------ | : ------ |
295
+ | Type Parameter | Description |
296
+ | ------ | ------ |
283
297
| ` T ` | The expected type of the response data when not using a specific ` responseType ` . |
284
298
285
299
### Parameters
286
300
287
301
| Parameter | Type | Description |
288
- | : ------ | : ------ | : ------ |
302
+ | ------ | ------ | ------ |
289
303
| ` url ` | ` string ` \| ` URL ` | The resource to fetch . Can be a URL object or a string representing a URL . |
290
304
| ` init ` | [` FetchInit ` ](../ interfaces / FetchInit .md ) | Additional options for the fetch operation , including custom ` FetchInit ` properties . |
291
305
@@ -295,9 +309,9 @@ Fetches a resource from the network and returns a `FetchResponse` or `FetchTask`
295
309
296
310
A ` FetchResponse ` or ` FetchTask ` depending on the ` abortable ` option in ` init ` .
297
311
298
- ### Source
312
+ ### Defined in
299
313
300
- [src / fetch / fetch .ts :131 ](https :// github.com/JiangJie/fetch-t/blob/6a5239d36df6ec2fbc78b194fa1370d9bdc8caa2 /src/fetch/fetch.ts#L131)
314
+ [src / fetch / fetch .ts :131 ](https :// github.com/JiangJie/fetch-t/blob/9e5c4ce034f7bf6add07f55044bccbb16a68960c /src/fetch/fetch.ts#L131)
301
315
302
316
## fetchT (url , init )
303
317
@@ -310,7 +324,7 @@ Fetches a resource from the network and returns a `FetchResponse` representing t
310
324
### Parameters
311
325
312
326
| Parameter | Type | Description |
313
- | : ------ | : ------ | : ------ |
327
+ | ------ | ------ | ------ |
314
328
| ` url ` | ` string ` \| ` URL ` | The resource to fetch . Can be a URL object or a string representing a URL . |
315
329
| ` init ` ? | ` RequestInit ` | Standard ` RequestInit ` options for the fetch operation . |
316
330
@@ -320,6 +334,6 @@ Fetches a resource from the network and returns a `FetchResponse` representing t
320
334
321
335
A ` FetchResponse ` representing the operation with a ` Response ` object .
322
336
323
- ### Source
337
+ ### Defined in
324
338
325
- [src / fetch / fetch .ts :140 ](https :// github.com/JiangJie/fetch-t/blob/6a5239d36df6ec2fbc78b194fa1370d9bdc8caa2 /src/fetch/fetch.ts#L140)
339
+ [src / fetch / fetch .ts :140 ](https :// github.com/JiangJie/fetch-t/blob/9e5c4ce034f7bf6add07f55044bccbb16a68960c /src/fetch/fetch.ts#L140)
0 commit comments