@dynatrace-sdk/http-client 1.0.10 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/cjs/index.js +86 -0
- package/docs/DOCS.md +599 -316
- package/esm/index.js +86 -0
- package/package.json +1 -1
- package/types/packages/http-client/src/index.d.ts +1 -1
- package/types/packages/http-client/src/lib/platform/index.d.ts +1 -0
- package/types/packages/http-client/src/lib/platform/oauth-http-client.d.ts +41 -0
package/docs/DOCS.md
CHANGED
|
@@ -3,23 +3,19 @@ title: "@dynatrace-sdk/http-client"
|
|
|
3
3
|
description: An environment agnostic (browser/deno vs nodejs) abstraction layer for making HTTP calls.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
# @dynatrace-sdk/http-client
|
|
7
8
|
|
|
8
9
|
An environment agnostic (browser/deno vs nodejs) abstraction layer for making HTTP calls.
|
|
9
10
|
|
|
10
|
-
import NpmLogo from
|
|
11
|
+
import NpmLogo from '@site/static/img/npm-logo.png';
|
|
11
12
|
|
|
12
13
|
<div class="row margin-bottom--md">
|
|
13
14
|
<div class="col">
|
|
14
|
-
<a href="https://www.npmjs.com/package/@dynatrace-sdk/http-client">
|
|
15
|
-
<span class="margin-right--xs">@dynatrace-sdk/http-client</span>
|
|
16
|
-
<img className="no-zoom" width="20px" src={NpmLogo} />
|
|
17
|
-
</a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/@dynatrace-sdk/http-client" target="_blank" rel="noopener noreferrer"> <span class="margin-right--xs">@dynatrace-sdk/http-client</span> <img className="no-zoom" width="20px" src={NpmLogo} /> </a>
|
|
18
16
|
</div>
|
|
19
|
-
<div class="col" style={{
|
|
20
|
-
<a href="https://www.npmjs.com/package/@dynatrace-sdk/http-client/v/1.
|
|
21
|
-
v1.0.10
|
|
22
|
-
</a>
|
|
17
|
+
<div class="col" style={{textAlign: 'right'}}>
|
|
18
|
+
<a href="https://www.npmjs.com/package/@dynatrace-sdk/http-client/v/1.1.1" target="_blank" rel="noopener noreferrer">v1.1.1</a>
|
|
23
19
|
</div>
|
|
24
20
|
</div>
|
|
25
21
|
|
|
@@ -27,52 +23,59 @@ import NpmLogo from "@site/static/img/npm-logo.png";
|
|
|
27
23
|
npm install @dynatrace-sdk/http-client
|
|
28
24
|
```
|
|
29
25
|
|
|
26
|
+
|
|
30
27
|
## Classes
|
|
31
28
|
|
|
32
29
|
### PlatformBaseError
|
|
33
|
-
|
|
34
30
|
<!-- default child "Class" -->
|
|
35
31
|
|
|
32
|
+
|
|
33
|
+
|
|
36
34
|
#### Constructors
|
|
37
35
|
|
|
38
36
|
##### new PlatformBaseError(message,cause?)
|
|
39
|
-
|
|
40
37
|
<div class="padding-left--md">
|
|
41
38
|
|
|
42
39
|
#### Parameters
|
|
43
40
|
|
|
44
|
-
| Name
|
|
45
|
-
|
|
46
|
-
|
|
|
47
|
-
|
|
|
41
|
+
| Name | Type|
|
|
42
|
+
|---|---|
|
|
43
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
44
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
48
|
|
|
49
49
|
</div>
|
|
50
50
|
|
|
51
|
+
|
|
52
|
+
|
|
51
53
|
#### Properties
|
|
52
54
|
|
|
53
|
-
| Name
|
|
54
|
-
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
55
|
+
| Name | Type|
|
|
56
|
+
|---|---|
|
|
57
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
58
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
59
|
+
|name<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
60
|
+
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
61
|
+
|prepareStackTrace|Object|
|
|
62
|
+
|stackTraceLimit<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)|
|
|
61
63
|
|
|
62
|
-
### PlatformBinary
|
|
63
64
|
|
|
65
|
+
### PlatformBinary
|
|
64
66
|
<!-- default child "Class" -->
|
|
65
|
-
|
|
66
67
|
Represents an environment agnostic (browser vs node) abstraction layer for binary data.
|
|
67
68
|
|
|
69
|
+
|
|
68
70
|
#### Properties
|
|
69
71
|
|
|
70
|
-
| Name
|
|
71
|
-
|
|
72
|
-
|
|
|
72
|
+
| Name | Type|
|
|
73
|
+
|---|---|
|
|
74
|
+
|data<sup>*required</sup>|ArrayBuffer | Blob | ReadableStream<Uint8Array>|
|
|
73
75
|
|
|
74
76
|
#### Methods
|
|
75
77
|
|
|
78
|
+
|
|
76
79
|
##### get
|
|
77
80
|
|
|
78
81
|
<div class="padding-bottom--md">
|
|
@@ -82,272 +85,339 @@ Represents an environment agnostic (browser vs node) abstraction layer for binar
|
|
|
82
85
|
|
|
83
86
|
Returns the binary data in a form that conforms to the specified type.
|
|
84
87
|
|
|
88
|
+
|
|
89
|
+
|
|
85
90
|
</div>
|
|
86
91
|
|
|
92
|
+
|
|
87
93
|
#### Parameters
|
|
88
94
|
|
|
89
|
-
| Name
|
|
90
|
-
|
|
91
|
-
|
|
|
95
|
+
| Name | Type| Description|
|
|
96
|
+
|---|---|---|
|
|
97
|
+
|type<sup>*required</sup>|T|<p>The type of the data. Can be <code>text</code>, <code>json</code>, <code>array-buffer</code>, <code>blob</code>, <code>readable-stream</code>, <code>buffer</code> or <code>stream</code>.</p> |
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
92
103
|
|
|
93
|
-
{/* no returns */}
|
|
94
104
|
|
|
95
105
|
</div>
|
|
96
106
|
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
97
110
|
##### from
|
|
98
111
|
|
|
99
112
|
<div class="padding-bottom--md">
|
|
100
|
-
<strong>from(data):
|
|
113
|
+
<strong>from(data): [Binary](#binary)</strong>
|
|
101
114
|
|
|
102
115
|
<div class="padding-left--md">
|
|
103
116
|
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
104
121
|
</div>
|
|
105
122
|
|
|
123
|
+
|
|
106
124
|
#### Parameters
|
|
107
125
|
|
|
108
|
-
| Name
|
|
109
|
-
|
|
110
|
-
|
|
|
126
|
+
| Name | Type|
|
|
127
|
+
|---|---|
|
|
128
|
+
|data<sup>*required</sup>|ArrayBuffer | Blob | ReadableStream<Uint8Array> | Buffer | Readable|
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
111
134
|
|
|
112
|
-
{/* no returns */}
|
|
113
135
|
|
|
114
136
|
</div>
|
|
115
137
|
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
116
141
|
##### fromJson
|
|
117
142
|
|
|
118
143
|
<div class="padding-bottom--md">
|
|
119
|
-
<strong>fromJson(json):
|
|
144
|
+
<strong>fromJson(json): [Binary](#binary)</strong>
|
|
120
145
|
|
|
121
146
|
<div class="padding-left--md">
|
|
122
147
|
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
123
152
|
</div>
|
|
124
153
|
|
|
154
|
+
|
|
125
155
|
#### Parameters
|
|
126
156
|
|
|
127
|
-
| Name
|
|
128
|
-
|
|
129
|
-
|
|
|
157
|
+
| Name | Type|
|
|
158
|
+
|---|---|
|
|
159
|
+
|json<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
130
165
|
|
|
131
|
-
{/* no returns */}
|
|
132
166
|
|
|
133
167
|
</div>
|
|
134
168
|
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
135
172
|
##### fromText
|
|
136
173
|
|
|
137
174
|
<div class="padding-bottom--md">
|
|
138
|
-
<strong>fromText(text):
|
|
175
|
+
<strong>fromText(text): [Binary](#binary)</strong>
|
|
139
176
|
|
|
140
177
|
<div class="padding-left--md">
|
|
141
178
|
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
142
183
|
</div>
|
|
143
184
|
|
|
185
|
+
|
|
144
186
|
#### Parameters
|
|
145
187
|
|
|
146
|
-
| Name
|
|
147
|
-
|
|
148
|
-
|
|
|
188
|
+
| Name | Type|
|
|
189
|
+
|---|---|
|
|
190
|
+
|text<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
149
196
|
|
|
150
|
-
{/* no returns */}
|
|
151
197
|
|
|
152
198
|
</div>
|
|
153
199
|
|
|
154
|
-
### PlatformDataTypeError
|
|
155
200
|
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
### PlatformDataTypeError
|
|
156
204
|
<!-- default child "Class" -->
|
|
157
205
|
|
|
206
|
+
|
|
207
|
+
|
|
158
208
|
#### Constructors
|
|
159
209
|
|
|
160
210
|
##### new PlatformDataTypeError(message,cause?)
|
|
161
|
-
|
|
162
211
|
<div class="padding-left--md">
|
|
163
212
|
|
|
164
213
|
#### Parameters
|
|
165
214
|
|
|
166
|
-
| Name
|
|
167
|
-
|
|
168
|
-
|
|
|
169
|
-
|
|
|
215
|
+
| Name | Type|
|
|
216
|
+
|---|---|
|
|
217
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
218
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
170
222
|
|
|
171
223
|
</div>
|
|
172
224
|
|
|
225
|
+
|
|
226
|
+
|
|
173
227
|
#### Properties
|
|
174
228
|
|
|
175
|
-
| Name
|
|
176
|
-
|
|
177
|
-
|
|
|
178
|
-
|
|
|
179
|
-
|
|
|
180
|
-
|
|
|
181
|
-
|
|
|
182
|
-
|
|
|
229
|
+
| Name | Type| Description|
|
|
230
|
+
|---|---|---|
|
|
231
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
232
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
233
|
+
|name<sup>*required</sup>|"DataTypeError"|The error name. |
|
|
234
|
+
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
235
|
+
|prepareStackTrace|Object| |
|
|
236
|
+
|stackTraceLimit<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)| |
|
|
183
237
|
|
|
184
|
-
### PlatformHttpClient
|
|
185
238
|
|
|
239
|
+
### PlatformHttpClient
|
|
186
240
|
<!-- default child "Class" -->
|
|
187
|
-
|
|
188
241
|
The http client that serves as an environment agnostic (browser vs node) abstraction for making http calls.
|
|
189
242
|
It handles the authentication of the requests made to the Platform Services and the Serverless Functions.
|
|
190
243
|
|
|
191
244
|
Currently, only the requests to the Platform Services and the Serverless Functions are supported.
|
|
192
245
|
|
|
246
|
+
|
|
193
247
|
#### Constructors
|
|
194
248
|
|
|
195
249
|
##### new PlatformHttpClient()
|
|
196
250
|
|
|
197
|
-
<div class="padding-left--md">
|
|
198
251
|
|
|
199
|
-
{/* no parameters */}
|
|
200
|
-
|
|
201
|
-
</div>
|
|
202
252
|
|
|
203
253
|
#### Methods
|
|
204
254
|
|
|
255
|
+
|
|
205
256
|
##### send
|
|
206
257
|
|
|
207
258
|
<div class="padding-bottom--md">
|
|
208
|
-
<strong>send(options): Promise<
|
|
259
|
+
<strong>send(options): Promise<[HttpClientResponse](#httpclientresponse)></strong>
|
|
209
260
|
|
|
210
261
|
<div class="padding-left--md">
|
|
211
262
|
|
|
212
263
|
Sends an http request as configured by the `options`.
|
|
213
264
|
Returns a promise that resolves with a response object for successful requests or rejects with an appropriate error
|
|
214
265
|
when one of the following situations happen:
|
|
215
|
-
|
|
216
266
|
- `DataTypeError` - request body does not conform to the specified request body type,
|
|
217
267
|
- `HttpClientRequestError` - request cannot be sent (e.g. due to network error or invalid request),
|
|
218
268
|
- `HttpClientResponseError` - response status is considered invalid by the status validator,
|
|
219
269
|
- `HttpClientAbortError` - request was aborted.
|
|
220
270
|
|
|
271
|
+
|
|
272
|
+
|
|
221
273
|
</div>
|
|
222
274
|
|
|
275
|
+
|
|
223
276
|
#### Parameters
|
|
224
277
|
|
|
225
|
-
| Name
|
|
226
|
-
|
|
227
|
-
|
|
|
278
|
+
| Name | Type| Description|
|
|
279
|
+
|---|---|---|
|
|
280
|
+
|options<sup>*required</sup>|[HttpClientRequestOptions](#httpclientrequestoptions)<T>|Options used to configure the request. |
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
228
284
|
|
|
229
285
|
#### Returns
|
|
230
286
|
|
|
231
287
|
Promise&lt;HttpClientResponse&gt; A promise that resolves with the response object or rejects with an error.
|
|
232
288
|
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
233
292
|
</div>
|
|
234
293
|
|
|
235
|
-
### PlatformHttpClientAbortError
|
|
236
294
|
|
|
237
|
-
<!-- default child "Class" -->
|
|
238
295
|
|
|
296
|
+
|
|
297
|
+
### PlatformHttpClientAbortError
|
|
298
|
+
<!-- default child "Class" -->
|
|
239
299
|
Represents a situation when the request was aborted.
|
|
240
300
|
|
|
301
|
+
|
|
241
302
|
#### Constructors
|
|
242
303
|
|
|
243
304
|
##### new PlatformHttpClientAbortError(cause)
|
|
244
|
-
|
|
245
305
|
<div class="padding-left--md">
|
|
246
306
|
|
|
247
307
|
#### Parameters
|
|
248
308
|
|
|
249
|
-
| Name
|
|
250
|
-
|
|
251
|
-
|
|
|
309
|
+
| Name | Type|
|
|
310
|
+
|---|---|
|
|
311
|
+
|cause<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
252
315
|
|
|
253
316
|
</div>
|
|
254
317
|
|
|
318
|
+
|
|
319
|
+
|
|
255
320
|
#### Properties
|
|
256
321
|
|
|
257
|
-
| Name
|
|
258
|
-
|
|
259
|
-
|
|
|
260
|
-
|
|
|
261
|
-
|
|
|
262
|
-
|
|
|
263
|
-
|
|
|
264
|
-
|
|
|
322
|
+
| Name | Type| Description|
|
|
323
|
+
|---|---|---|
|
|
324
|
+
|cause<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
325
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
326
|
+
|name<sup>*required</sup>|"AbortError"|The error name. |
|
|
327
|
+
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
328
|
+
|prepareStackTrace|Object| |
|
|
329
|
+
|stackTraceLimit<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)| |
|
|
265
330
|
|
|
266
|
-
### PlatformHttpClientRequestError
|
|
267
331
|
|
|
332
|
+
### PlatformHttpClientRequestError
|
|
268
333
|
<!-- default child "Class" -->
|
|
269
|
-
|
|
270
334
|
Represents a situation when the request is invalid and cannot be sent.
|
|
271
335
|
|
|
336
|
+
|
|
272
337
|
#### Constructors
|
|
273
338
|
|
|
274
339
|
##### new PlatformHttpClientRequestError(cause)
|
|
275
|
-
|
|
276
340
|
<div class="padding-left--md">
|
|
277
341
|
|
|
278
342
|
#### Parameters
|
|
279
343
|
|
|
280
|
-
| Name
|
|
281
|
-
|
|
282
|
-
|
|
|
344
|
+
| Name | Type|
|
|
345
|
+
|---|---|
|
|
346
|
+
|cause<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
283
350
|
|
|
284
351
|
</div>
|
|
285
352
|
|
|
353
|
+
|
|
354
|
+
|
|
286
355
|
#### Properties
|
|
287
356
|
|
|
288
|
-
| Name
|
|
289
|
-
|
|
290
|
-
|
|
|
291
|
-
|
|
|
292
|
-
|
|
|
293
|
-
|
|
|
294
|
-
|
|
|
295
|
-
|
|
|
357
|
+
| Name | Type| Description|
|
|
358
|
+
|---|---|---|
|
|
359
|
+
|cause<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
360
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
361
|
+
|name<sup>*required</sup>|"RequestError"|The error name. |
|
|
362
|
+
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
363
|
+
|prepareStackTrace|Object| |
|
|
364
|
+
|stackTraceLimit<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)| |
|
|
296
365
|
|
|
297
|
-
### PlatformHttpClientResponse
|
|
298
366
|
|
|
367
|
+
### PlatformHttpClientResponse
|
|
299
368
|
<!-- default child "Class" -->
|
|
300
|
-
|
|
301
369
|
Represents the response to a request.
|
|
302
370
|
|
|
371
|
+
|
|
303
372
|
#### Constructors
|
|
304
373
|
|
|
305
374
|
##### new PlatformHttpClientResponse(response)
|
|
306
|
-
|
|
307
375
|
<div class="padding-left--md">
|
|
308
376
|
|
|
309
377
|
#### Parameters
|
|
310
378
|
|
|
311
|
-
| Name
|
|
312
|
-
|
|
313
|
-
|
|
|
379
|
+
| Name | Type|
|
|
380
|
+
|---|---|
|
|
381
|
+
|response<sup>*required</sup>|Response|
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
314
385
|
|
|
315
386
|
</div>
|
|
316
387
|
|
|
388
|
+
|
|
389
|
+
|
|
317
390
|
#### Properties
|
|
318
391
|
|
|
319
|
-
| Name
|
|
320
|
-
|
|
321
|
-
|
|
|
392
|
+
| Name | Type|
|
|
393
|
+
|---|---|
|
|
394
|
+
|response<sup>*required</sup>|Response|
|
|
322
395
|
|
|
323
396
|
#### Accessors
|
|
324
397
|
|
|
325
398
|
##### headers
|
|
326
|
-
|
|
327
399
|
<!-- default child "Accessor" -->
|
|
328
|
-
|
|
329
400
|
The response headers.
|
|
330
401
|
|
|
331
|
-
##### status
|
|
332
402
|
|
|
403
|
+
##### status
|
|
333
404
|
<!-- default child "Accessor" -->
|
|
334
|
-
|
|
335
405
|
The status code of the response.
|
|
336
406
|
|
|
337
|
-
##### statusText
|
|
338
407
|
|
|
408
|
+
##### statusText
|
|
339
409
|
<!-- default child "Accessor" -->
|
|
340
|
-
|
|
341
410
|
The status message corresponding to the status code.
|
|
342
411
|
|
|
343
|
-
##### url
|
|
344
412
|
|
|
413
|
+
##### url
|
|
345
414
|
<!-- default child "Accessor" -->
|
|
346
|
-
|
|
347
415
|
The URL of the response.
|
|
348
416
|
|
|
417
|
+
|
|
349
418
|
#### Methods
|
|
350
419
|
|
|
420
|
+
|
|
351
421
|
##### body
|
|
352
422
|
|
|
353
423
|
<div class="padding-bottom--md">
|
|
@@ -357,99 +427,180 @@ The URL of the response.
|
|
|
357
427
|
|
|
358
428
|
Returns the response body in a form that conforms to the specified response body type.
|
|
359
429
|
|
|
430
|
+
|
|
431
|
+
|
|
360
432
|
</div>
|
|
361
433
|
|
|
434
|
+
|
|
362
435
|
#### Parameters
|
|
363
436
|
|
|
364
|
-
| Name
|
|
365
|
-
|
|
366
|
-
|
|
|
437
|
+
| Name | Type| Description|
|
|
438
|
+
|---|---|---|
|
|
439
|
+
|responseBodyType<sup>*required</sup>|T|<p>The type of the response body. Can be <code>text</code>, <code>json</code>, <code>binary</code>, <code>form-data</code>, <code>array-buffer</code>, <code>blob</code>, <code>readable-stream</code>, <code>buffer</code> or <code>stream</code>. The default response body type is <code>json</code>.</p> |
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
|
|
367
445
|
|
|
368
|
-
{/* no returns */}
|
|
369
446
|
|
|
370
447
|
</div>
|
|
371
448
|
|
|
372
|
-
### PlatformHttpClientResponseError
|
|
373
449
|
|
|
374
|
-
<!-- default child "Class" -->
|
|
375
450
|
|
|
451
|
+
|
|
452
|
+
### PlatformHttpClientResponseError
|
|
453
|
+
<!-- default child "Class" -->
|
|
376
454
|
Represents a situation when the response status is considered invalid by the status validator.
|
|
377
455
|
|
|
456
|
+
|
|
378
457
|
#### Constructors
|
|
379
458
|
|
|
380
459
|
##### new PlatformHttpClientResponseError(response,data?)
|
|
381
|
-
|
|
382
460
|
<div class="padding-left--md">
|
|
383
461
|
|
|
384
462
|
#### Parameters
|
|
385
463
|
|
|
386
|
-
| Name
|
|
387
|
-
|
|
388
|
-
|
|
|
389
|
-
|
|
|
390
|
-
|
|
|
464
|
+
| Name | Type|
|
|
465
|
+
|---|---|
|
|
466
|
+
|response<sup>*required</sup>|Response|
|
|
467
|
+
|data|Object|
|
|
468
|
+
|data.requestMethod|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
391
472
|
|
|
392
473
|
</div>
|
|
393
474
|
|
|
475
|
+
|
|
476
|
+
|
|
394
477
|
#### Properties
|
|
395
478
|
|
|
396
|
-
| Name
|
|
397
|
-
|
|
398
|
-
|
|
|
399
|
-
|
|
|
400
|
-
|
|
|
401
|
-
|
|
|
402
|
-
|
|
|
403
|
-
|
|
|
404
|
-
|
|
|
405
|
-
|
|
|
479
|
+
| Name | Type| Description|
|
|
480
|
+
|---|---|---|
|
|
481
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
482
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
483
|
+
|name<sup>*required</sup>|"ResponseError"|The error name. |
|
|
484
|
+
|requestMethod|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
485
|
+
|response<sup>*required</sup>|[HttpClientResponse](#httpclientresponse)|The response. |
|
|
486
|
+
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
487
|
+
|prepareStackTrace|Object| |
|
|
488
|
+
|stackTraceLimit<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)| |
|
|
406
489
|
|
|
407
|
-
### PlatformUnsupportedOperationError
|
|
408
490
|
|
|
491
|
+
### PlatformUnsupportedOperationError
|
|
409
492
|
<!-- default child "Class" -->
|
|
410
493
|
|
|
494
|
+
|
|
495
|
+
|
|
411
496
|
#### Constructors
|
|
412
497
|
|
|
413
498
|
##### new PlatformUnsupportedOperationError(message,cause?)
|
|
414
|
-
|
|
415
499
|
<div class="padding-left--md">
|
|
416
500
|
|
|
417
501
|
#### Parameters
|
|
418
502
|
|
|
419
|
-
| Name
|
|
420
|
-
|
|
421
|
-
|
|
|
422
|
-
|
|
|
503
|
+
| Name | Type|
|
|
504
|
+
|---|---|
|
|
505
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
506
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
|
|
423
510
|
|
|
424
511
|
</div>
|
|
425
512
|
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
#### Properties
|
|
516
|
+
|
|
517
|
+
| Name | Type| Description|
|
|
518
|
+
|---|---|---|
|
|
519
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
520
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
521
|
+
|name<sup>*required</sup>|"UnsupportedOperationError"|The error name. |
|
|
522
|
+
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
523
|
+
|prepareStackTrace|Object| |
|
|
524
|
+
|stackTraceLimit<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)| |
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
### _OAuthHttpClient
|
|
528
|
+
<!-- default child "Class" -->
|
|
529
|
+
DO NOT USE - internal use only.
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
#### Constructors
|
|
533
|
+
|
|
534
|
+
##### new _OAuthHttpClient(config)
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
426
538
|
#### Properties
|
|
427
539
|
|
|
428
|
-
| Name
|
|
429
|
-
|
|
430
|
-
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
540
|
+
| Name | Type|
|
|
541
|
+
|---|---|
|
|
542
|
+
|oauthToken|OAuthToken|
|
|
543
|
+
|
|
544
|
+
#### Methods
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
##### send
|
|
548
|
+
|
|
549
|
+
<div class="padding-bottom--md">
|
|
550
|
+
<strong>send(options): Promise<[HttpClientResponse](#httpclientresponse)></strong>
|
|
551
|
+
|
|
552
|
+
<div class="padding-left--md">
|
|
553
|
+
|
|
554
|
+
Sends an http request as configured by the `options`.
|
|
555
|
+
Returns a promise that resolves with a response object for successful requests or rejects with an appropriate error
|
|
556
|
+
when one of the following situations happen:
|
|
557
|
+
- `DataTypeError` - request body does not conform to the specified request body type,
|
|
558
|
+
- `HttpClientRequestError` - request cannot be sent (e.g. due to network error or invalid request),
|
|
559
|
+
- `HttpClientResponseError` - response status is considered invalid by the status validator,
|
|
560
|
+
- `HttpClientAbortError` - request was aborted.
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
</div>
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
#### Parameters
|
|
568
|
+
|
|
569
|
+
| Name | Type| Description|
|
|
570
|
+
|---|---|---|
|
|
571
|
+
|options<sup>*required</sup>|[HttpClientRequestOptions](#httpclientrequestoptions)<T>|Options used to configure the request. |
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
#### Returns
|
|
577
|
+
|
|
578
|
+
Promise&lt;HttpClientResponse&gt; A promise that resolves with the response object or rejects with an error.
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
</div>
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
|
|
436
587
|
|
|
437
588
|
## Interfaces
|
|
438
589
|
|
|
439
590
|
### AbortController
|
|
440
|
-
|
|
441
591
|
<!-- default child "Interface" -->
|
|
442
|
-
|
|
443
592
|
Represents a controller object that allows to abort one or more requests as and when desired.
|
|
444
593
|
|
|
594
|
+
|
|
445
595
|
#### Properties
|
|
446
596
|
|
|
447
|
-
| Name
|
|
448
|
-
|
|
449
|
-
|
|
|
597
|
+
| Name | Type| Description|
|
|
598
|
+
|---|---|---|
|
|
599
|
+
|signal<sup>*required</sup>|[AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)|Returns an AbortSignal object instance, which can be used to communicate with a request. |
|
|
450
600
|
|
|
451
601
|
#### Methods
|
|
452
602
|
|
|
603
|
+
|
|
453
604
|
##### abort
|
|
454
605
|
|
|
455
606
|
<div class="padding-bottom--md">
|
|
@@ -459,30 +610,36 @@ Represents a controller object that allows to abort one or more requests as and
|
|
|
459
610
|
|
|
460
611
|
Aborts a request before it has completed.
|
|
461
612
|
|
|
613
|
+
|
|
614
|
+
|
|
462
615
|
</div>
|
|
463
616
|
|
|
464
|
-
{/* no parameters */}
|
|
465
617
|
|
|
466
|
-
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
467
621
|
|
|
468
622
|
</div>
|
|
469
623
|
|
|
470
|
-
### AbortSignal
|
|
471
624
|
|
|
472
|
-
<!-- default child "Interface" -->
|
|
473
625
|
|
|
626
|
+
|
|
627
|
+
### AbortSignal
|
|
628
|
+
<!-- default child "Interface" -->
|
|
474
629
|
Represents a signal object that allows to communicate with the request and abort it using the `AbortController`.
|
|
475
630
|
|
|
631
|
+
|
|
476
632
|
#### Properties
|
|
477
633
|
|
|
478
|
-
| Name
|
|
479
|
-
|
|
480
|
-
|
|
|
481
|
-
|
|
|
482
|
-
|
|
|
634
|
+
| Name | Type| Description|
|
|
635
|
+
|---|---|---|
|
|
636
|
+
|aborted<sup>*required</sup>|[boolean](https://developer.mozilla.org/en-US/docs/Glossary/Boolean)|A flag indicating whether the requests the signal is communicating with are aborted. |
|
|
637
|
+
|onabort<sup>*required</sup>|null | Object|Invoked when the requests the signal is communicating with are aborted. |
|
|
638
|
+
|reason<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)| |
|
|
483
639
|
|
|
484
640
|
#### Methods
|
|
485
641
|
|
|
642
|
+
|
|
486
643
|
##### throwIfAborted
|
|
487
644
|
|
|
488
645
|
<div class="padding-bottom--md">
|
|
@@ -490,35 +647,45 @@ Represents a signal object that allows to communicate with the request and abort
|
|
|
490
647
|
|
|
491
648
|
<div class="padding-left--md">
|
|
492
649
|
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
|
|
493
654
|
</div>
|
|
494
655
|
|
|
495
|
-
{/* no parameters */}
|
|
496
656
|
|
|
497
|
-
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
|
|
498
660
|
|
|
499
661
|
</div>
|
|
500
662
|
|
|
501
|
-
### BaseError
|
|
502
663
|
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
### BaseError
|
|
503
667
|
<!-- default child "Interface" -->
|
|
504
668
|
|
|
669
|
+
|
|
670
|
+
|
|
505
671
|
#### Properties
|
|
506
672
|
|
|
507
|
-
| Name
|
|
508
|
-
|
|
509
|
-
|
|
|
510
|
-
|
|
|
511
|
-
|
|
|
512
|
-
|
|
|
673
|
+
| Name | Type|
|
|
674
|
+
|---|---|
|
|
675
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
676
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
677
|
+
|name<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
678
|
+
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
513
679
|
|
|
514
|
-
### Binary
|
|
515
680
|
|
|
681
|
+
### Binary
|
|
516
682
|
<!-- default child "Interface" -->
|
|
517
|
-
|
|
518
683
|
Represents an environment agnostic (browser vs node) abstraction layer for binary data.
|
|
519
684
|
|
|
685
|
+
|
|
520
686
|
#### Methods
|
|
521
687
|
|
|
688
|
+
|
|
522
689
|
##### get
|
|
523
690
|
|
|
524
691
|
<div class="padding-bottom--md">
|
|
@@ -528,187 +695,211 @@ Represents an environment agnostic (browser vs node) abstraction layer for binar
|
|
|
528
695
|
|
|
529
696
|
Returns the binary data in a form that conforms to the specified type.
|
|
530
697
|
|
|
698
|
+
|
|
699
|
+
|
|
531
700
|
</div>
|
|
532
701
|
|
|
702
|
+
|
|
533
703
|
#### Parameters
|
|
534
704
|
|
|
535
|
-
| Name
|
|
536
|
-
|
|
537
|
-
|
|
|
705
|
+
| Name | Type| Description|
|
|
706
|
+
|---|---|---|
|
|
707
|
+
|type<sup>*required</sup>|T|<p>The type of the data. Can be <code>text</code>, <code>json</code>, <code>array-buffer</code>, <code>blob</code>, <code>readable-stream</code>, <code>buffer</code> or <code>stream</code>.</p> |
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
|
|
538
713
|
|
|
539
|
-
{/* no returns */}
|
|
540
714
|
|
|
541
715
|
</div>
|
|
542
716
|
|
|
543
|
-
### BinaryFormDataRequestField
|
|
544
717
|
|
|
545
|
-
<!-- default child "Interface" -->
|
|
546
718
|
|
|
719
|
+
|
|
720
|
+
### BinaryFormDataRequestField
|
|
721
|
+
<!-- default child "Interface" -->
|
|
547
722
|
Represents an binary field.
|
|
548
723
|
|
|
724
|
+
|
|
549
725
|
#### Properties
|
|
550
726
|
|
|
551
|
-
| Name
|
|
552
|
-
|
|
553
|
-
|
|
|
554
|
-
|
|
|
555
|
-
|
|
|
556
|
-
|
|
|
557
|
-
|
|
|
727
|
+
| Name | Type| Description|
|
|
728
|
+
|---|---|---|
|
|
729
|
+
|contentType|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|<p>The content type of the data contained in <code>value</code>. The default content type for the binary is 'application/octet-stream'.</p> |
|
|
730
|
+
|filename|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|<p>The filename reported to the server. The default filename for the binary is 'binary'.</p> |
|
|
731
|
+
|name<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|The name of the field. |
|
|
732
|
+
|type<sup>*required</sup>|"binary"|A binary field type discriminator. |
|
|
733
|
+
|value<sup>*required</sup>|ArrayBuffer | Blob | Buffer | Readable | [Binary](#binary) | ReadableStream<[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)> | File|The field's value. |
|
|
558
734
|
|
|
559
|
-
### BinaryFormDataResponseField
|
|
560
735
|
|
|
736
|
+
### BinaryFormDataResponseField
|
|
561
737
|
<!-- default child "Interface" -->
|
|
562
738
|
|
|
739
|
+
|
|
740
|
+
|
|
563
741
|
#### Properties
|
|
564
742
|
|
|
565
|
-
| Name
|
|
566
|
-
|
|
567
|
-
|
|
|
568
|
-
|
|
|
569
|
-
|
|
|
570
|
-
|
|
|
571
|
-
|
|
|
743
|
+
| Name | Type|
|
|
744
|
+
|---|---|
|
|
745
|
+
|contentType<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
746
|
+
|filename<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
747
|
+
|name<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
748
|
+
|type<sup>*required</sup>|"binary"|
|
|
749
|
+
|value<sup>*required</sup>|[Binary](#binary)|
|
|
572
750
|
|
|
573
|
-
### DataTypeError
|
|
574
751
|
|
|
752
|
+
### DataTypeError
|
|
575
753
|
<!-- default child "Interface" -->
|
|
576
754
|
|
|
755
|
+
|
|
756
|
+
|
|
577
757
|
#### Properties
|
|
578
758
|
|
|
579
|
-
| Name
|
|
580
|
-
|
|
581
|
-
|
|
|
582
|
-
|
|
|
583
|
-
|
|
|
584
|
-
|
|
|
759
|
+
| Name | Type| Description|
|
|
760
|
+
|---|---|---|
|
|
761
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
762
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
763
|
+
|name<sup>*required</sup>|"DataTypeError"|The error name. |
|
|
764
|
+
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
585
765
|
|
|
586
|
-
### Headers
|
|
587
766
|
|
|
767
|
+
### Headers
|
|
588
768
|
<!-- default child "Interface" -->
|
|
589
|
-
|
|
590
769
|
Represents http headers.
|
|
591
770
|
|
|
592
|
-
### HttpClient
|
|
593
771
|
|
|
772
|
+
### HttpClient
|
|
594
773
|
<!-- default child "Interface" -->
|
|
595
|
-
|
|
596
774
|
The http client that serves as an environment agnostic (browser vs node) abstraction for making http calls.
|
|
597
775
|
It handles the authentication of the requests made to the Platform Services and the Serverless Functions.
|
|
598
776
|
|
|
599
777
|
Currently, only the requests to the Platform Services and the Serverless Functions are supported.
|
|
600
778
|
|
|
779
|
+
|
|
601
780
|
#### Methods
|
|
602
781
|
|
|
782
|
+
|
|
603
783
|
##### send
|
|
604
784
|
|
|
605
785
|
<div class="padding-bottom--md">
|
|
606
|
-
<strong>send(options): Promise<
|
|
786
|
+
<strong>send(options): Promise<[HttpClientResponse](#httpclientresponse)></strong>
|
|
607
787
|
|
|
608
788
|
<div class="padding-left--md">
|
|
609
789
|
|
|
610
790
|
Sends an http request as configured by the `options`.
|
|
611
791
|
Returns a promise that resolves with a response object for successful requests or rejects with an appropriate error
|
|
612
792
|
when one of the following situations happen:
|
|
613
|
-
|
|
614
793
|
- `DataTypeError` - request body does not conform to the specified request body type,
|
|
615
794
|
- `HttpClientRequestError` - request cannot be sent (e.g. due to network error or invalid request),
|
|
616
795
|
- `HttpClientResponseError` - response status is considered invalid by the status validator,
|
|
617
796
|
- `HttpClientAbortError` - request was aborted.
|
|
618
797
|
|
|
798
|
+
|
|
799
|
+
|
|
619
800
|
</div>
|
|
620
801
|
|
|
802
|
+
|
|
621
803
|
#### Parameters
|
|
622
804
|
|
|
623
|
-
| Name
|
|
624
|
-
|
|
625
|
-
|
|
|
805
|
+
| Name | Type| Description|
|
|
806
|
+
|---|---|---|
|
|
807
|
+
|options<sup>*required</sup>|[HttpClientRequestOptions](#httpclientrequestoptions)<T>|Options used to configure the request. |
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
|
|
626
811
|
|
|
627
812
|
#### Returns
|
|
628
813
|
|
|
629
814
|
Promise&lt;HttpClientResponse&gt; A promise that resolves with the response object or rejects with an error.
|
|
630
815
|
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
|
|
631
819
|
</div>
|
|
632
820
|
|
|
633
|
-
### HttpClientAbortError
|
|
634
821
|
|
|
635
|
-
<!-- default child "Interface" -->
|
|
636
822
|
|
|
823
|
+
|
|
824
|
+
### HttpClientAbortError
|
|
825
|
+
<!-- default child "Interface" -->
|
|
637
826
|
Represents a situation when the request was aborted.
|
|
638
827
|
|
|
828
|
+
|
|
639
829
|
#### Properties
|
|
640
830
|
|
|
641
|
-
| Name
|
|
642
|
-
|
|
643
|
-
|
|
|
644
|
-
|
|
|
645
|
-
|
|
|
646
|
-
|
|
|
831
|
+
| Name | Type| Description|
|
|
832
|
+
|---|---|---|
|
|
833
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
834
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
835
|
+
|name<sup>*required</sup>|"AbortError"|The error name. |
|
|
836
|
+
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
647
837
|
|
|
648
|
-
### HttpClientNetworkError
|
|
649
838
|
|
|
839
|
+
### HttpClientNetworkError
|
|
650
840
|
<!-- default child "Interface" -->
|
|
651
|
-
|
|
652
841
|
Represents a situation when a network error occurred.
|
|
653
842
|
|
|
843
|
+
|
|
654
844
|
#### Properties
|
|
655
845
|
|
|
656
|
-
| Name
|
|
657
|
-
|
|
658
|
-
|
|
|
659
|
-
|
|
|
660
|
-
|
|
|
661
|
-
|
|
|
846
|
+
| Name | Type| Description|
|
|
847
|
+
|---|---|---|
|
|
848
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
849
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
850
|
+
|name<sup>*required</sup>|"NetworkError"|The error name. |
|
|
851
|
+
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
662
852
|
|
|
663
|
-
### HttpClientRequestError
|
|
664
853
|
|
|
854
|
+
### HttpClientRequestError
|
|
665
855
|
<!-- default child "Interface" -->
|
|
666
|
-
|
|
667
856
|
Represents a situation when the request is invalid and cannot be sent.
|
|
668
857
|
|
|
858
|
+
|
|
669
859
|
#### Properties
|
|
670
860
|
|
|
671
|
-
| Name
|
|
672
|
-
|
|
673
|
-
|
|
|
674
|
-
|
|
|
675
|
-
|
|
|
676
|
-
|
|
|
861
|
+
| Name | Type| Description|
|
|
862
|
+
|---|---|---|
|
|
863
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
864
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
865
|
+
|name<sup>*required</sup>|"RequestError"|The error name. |
|
|
866
|
+
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
677
867
|
|
|
678
|
-
### HttpClientRequestOptions
|
|
679
868
|
|
|
869
|
+
### HttpClientRequestOptions
|
|
680
870
|
<!-- default child "Interface" -->
|
|
681
|
-
|
|
682
871
|
Represents the options used to configure the request.
|
|
683
872
|
|
|
873
|
+
|
|
684
874
|
#### Properties
|
|
685
875
|
|
|
686
|
-
| Name
|
|
687
|
-
|
|
688
|
-
|
|
|
689
|
-
|
|
|
690
|
-
|
|
|
691
|
-
|
|
|
692
|
-
|
|
|
693
|
-
|
|
|
876
|
+
| Name | Type| Description|
|
|
877
|
+
|---|---|---|
|
|
878
|
+
|body|RequestBodyTypes<T>|<p>A request body that will be send along with the request. The structure of the request body needs to conform to the specified request body type.</p> |
|
|
879
|
+
|headers|[Headers](#headers)|The request headers. |
|
|
880
|
+
|method|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|The request method, e.g. <code>GET</code>, <code>POST</code>. |
|
|
881
|
+
|requestBodyType|T|<p>The type of the request body. Can be <code>text</code>, <code>json</code>, <code>binary</code> or <code>form-data</code>. The default request body type is <code>json</code>.</p> |
|
|
882
|
+
|statusValidator|[StatusValidator](#statusvalidator)|<p>A custom status validator function. If the status validator function returns <code>true</code> the returned promise resolves with the <code>HttpClientResponse</code> Otherwise the promise rejects with the <code>StatusError</code>. The default status validator function considers the <code>2xx</code> status codes as valid.</p> |
|
|
883
|
+
|url<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|The URL of the resource to fetch. |
|
|
694
884
|
|
|
695
|
-
### HttpClientResponse
|
|
696
885
|
|
|
886
|
+
### HttpClientResponse
|
|
697
887
|
<!-- default child "Interface" -->
|
|
698
|
-
|
|
699
888
|
Represents the response to a request.
|
|
700
889
|
|
|
890
|
+
|
|
701
891
|
#### Properties
|
|
702
892
|
|
|
703
|
-
| Name
|
|
704
|
-
|
|
705
|
-
|
|
|
706
|
-
|
|
|
707
|
-
|
|
|
708
|
-
|
|
|
893
|
+
| Name | Type| Description|
|
|
894
|
+
|---|---|---|
|
|
895
|
+
|headers<sup>*required</sup>|[Headers](#headers)|The response headers. |
|
|
896
|
+
|status<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)|The status code of the response. |
|
|
897
|
+
|statusText<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|The status message corresponding to the status code. |
|
|
898
|
+
|url<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|The URL of the response. |
|
|
709
899
|
|
|
710
900
|
#### Methods
|
|
711
901
|
|
|
902
|
+
|
|
712
903
|
##### body
|
|
713
904
|
|
|
714
905
|
<div class="padding-bottom--md">
|
|
@@ -718,92 +909,123 @@ Represents the response to a request.
|
|
|
718
909
|
|
|
719
910
|
Returns the response body in a form that conforms to the specified response body type.
|
|
720
911
|
|
|
912
|
+
|
|
913
|
+
|
|
721
914
|
</div>
|
|
722
915
|
|
|
916
|
+
|
|
723
917
|
#### Parameters
|
|
724
918
|
|
|
725
|
-
| Name
|
|
726
|
-
|
|
727
|
-
|
|
|
919
|
+
| Name | Type| Description|
|
|
920
|
+
|---|---|---|
|
|
921
|
+
|responseBodyType|T|<p>The type of the response body. Can be <code>text</code>, <code>json</code>, <code>binary</code>, <code>form-data</code>, <code>array-buffer</code>, <code>blob</code>, <code>readable-stream</code>, <code>buffer</code> or <code>stream</code>. The default response body type is <code>json</code>.</p> |
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
|
|
728
927
|
|
|
729
|
-
{/* no returns */}
|
|
730
928
|
|
|
731
929
|
</div>
|
|
732
930
|
|
|
733
|
-
### HttpClientResponseError
|
|
734
931
|
|
|
735
|
-
<!-- default child "Interface" -->
|
|
736
932
|
|
|
933
|
+
|
|
934
|
+
### HttpClientResponseError
|
|
935
|
+
<!-- default child "Interface" -->
|
|
737
936
|
Represents a situation when the response status is considered invalid by the status validator.
|
|
738
937
|
|
|
938
|
+
|
|
739
939
|
#### Properties
|
|
740
940
|
|
|
741
|
-
| Name
|
|
742
|
-
|
|
743
|
-
|
|
|
744
|
-
|
|
|
745
|
-
|
|
|
746
|
-
|
|
|
747
|
-
|
|
|
941
|
+
| Name | Type| Description|
|
|
942
|
+
|---|---|---|
|
|
943
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
944
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
945
|
+
|name<sup>*required</sup>|"ResponseError"|The error name. |
|
|
946
|
+
|response<sup>*required</sup>|[HttpClientResponse](#httpclientresponse)|The response. |
|
|
947
|
+
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
748
948
|
|
|
749
|
-
### JsonFormDataRequestField
|
|
750
949
|
|
|
950
|
+
### JsonFormDataRequestField
|
|
751
951
|
<!-- default child "Interface" -->
|
|
752
|
-
|
|
753
952
|
Represents a JSON field.
|
|
754
953
|
|
|
954
|
+
|
|
755
955
|
#### Properties
|
|
756
956
|
|
|
757
|
-
| Name
|
|
758
|
-
|
|
759
|
-
|
|
|
760
|
-
|
|
|
761
|
-
|
|
|
762
|
-
|
|
|
763
|
-
|
|
|
957
|
+
| Name | Type| Description|
|
|
958
|
+
|---|---|---|
|
|
959
|
+
|contentType|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|<p>The content type of the data contained in <code>value</code>. The default content type for the JSON is 'application/json'.</p> |
|
|
960
|
+
|filename|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|<p>The filename reported to the server. The default filename for the JSON is 'json'.</p> |
|
|
961
|
+
|name<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|The name of the field. |
|
|
962
|
+
|type<sup>*required</sup>|"json"|A JSON field type discriminator. |
|
|
963
|
+
|value<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The field's value. |
|
|
764
964
|
|
|
765
|
-
### StatusValidator
|
|
766
965
|
|
|
966
|
+
### StatusValidator
|
|
767
967
|
<!-- default child "Interface" -->
|
|
768
968
|
|
|
769
|
-
### TextFormDataRequestField
|
|
770
969
|
|
|
771
|
-
<!-- default child "Interface" -->
|
|
772
970
|
|
|
971
|
+
### TextFormDataRequestField
|
|
972
|
+
<!-- default child "Interface" -->
|
|
773
973
|
Represents a plain text field. No filename and content type is set.
|
|
774
974
|
|
|
975
|
+
|
|
775
976
|
#### Properties
|
|
776
977
|
|
|
777
|
-
| Name
|
|
778
|
-
|
|
779
|
-
|
|
|
780
|
-
|
|
|
781
|
-
|
|
|
978
|
+
| Name | Type| Description|
|
|
979
|
+
|---|---|---|
|
|
980
|
+
|name<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|The name of the field. |
|
|
981
|
+
|type<sup>*required</sup>|"text"|A plain text field type discriminator. |
|
|
982
|
+
|value<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|The field's value. |
|
|
782
983
|
|
|
783
|
-
### TextFormDataResponseField
|
|
784
984
|
|
|
985
|
+
### TextFormDataResponseField
|
|
785
986
|
<!-- default child "Interface" -->
|
|
786
987
|
|
|
988
|
+
|
|
989
|
+
|
|
787
990
|
#### Properties
|
|
788
991
|
|
|
789
|
-
| Name
|
|
790
|
-
|
|
791
|
-
|
|
|
792
|
-
|
|
|
793
|
-
|
|
|
992
|
+
| Name | Type|
|
|
993
|
+
|---|---|
|
|
994
|
+
|name<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
995
|
+
|type<sup>*required</sup>|"text"|
|
|
996
|
+
|value<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
997
|
+
|
|
794
998
|
|
|
795
999
|
### UnsupportedOperationError
|
|
1000
|
+
<!-- default child "Interface" -->
|
|
1001
|
+
|
|
1002
|
+
|
|
796
1003
|
|
|
1004
|
+
#### Properties
|
|
1005
|
+
|
|
1006
|
+
| Name | Type| Description|
|
|
1007
|
+
|---|---|---|
|
|
1008
|
+
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
1009
|
+
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
1010
|
+
|name<sup>*required</sup>|"UnsupportedOperationError"|The error name. |
|
|
1011
|
+
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
### _OAuthHttpClientConfig
|
|
797
1015
|
<!-- default child "Interface" -->
|
|
1016
|
+
DO NOT USE - internal use only.
|
|
1017
|
+
|
|
798
1018
|
|
|
799
1019
|
#### Properties
|
|
800
1020
|
|
|
801
|
-
| Name
|
|
802
|
-
|
|
803
|
-
|
|
|
804
|
-
|
|
|
805
|
-
|
|
|
806
|
-
|
|
|
1021
|
+
| Name | Type|
|
|
1022
|
+
|---|---|
|
|
1023
|
+
|authUrl<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
1024
|
+
|clientId<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
1025
|
+
|environmentUrl<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
1026
|
+
|scopes<sup>*required</sup>|Array<[string](https://developer.mozilla.org/en-US/docs/Glossary/String)>|
|
|
1027
|
+
|secret<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
1028
|
+
|
|
807
1029
|
|
|
808
1030
|
## Variables
|
|
809
1031
|
|
|
@@ -811,28 +1033,41 @@ Represents a plain text field. No filename and content type is set.
|
|
|
811
1033
|
<strong>PlatformAbortController</strong>: Object
|
|
812
1034
|
<div class="padding-left--md">
|
|
813
1035
|
|
|
1036
|
+
|
|
1037
|
+
|
|
814
1038
|
</div>
|
|
815
1039
|
|
|
1040
|
+
|
|
1041
|
+
|
|
816
1042
|
</div>
|
|
817
1043
|
|
|
818
1044
|
<div class="padding-left--md padding-bottom--md">
|
|
819
1045
|
<strong>PlatformAbortSignal</strong>: Object
|
|
820
1046
|
<div class="padding-left--md">
|
|
821
1047
|
|
|
1048
|
+
|
|
1049
|
+
|
|
822
1050
|
</div>
|
|
823
1051
|
|
|
1052
|
+
|
|
1053
|
+
|
|
824
1054
|
</div>
|
|
825
1055
|
|
|
826
1056
|
<div class="padding-left--md padding-bottom--md">
|
|
827
|
-
<strong>httpClient</strong>:
|
|
1057
|
+
<strong>httpClient</strong>: [HttpClient](#httpclient)
|
|
828
1058
|
<div class="padding-left--md">
|
|
829
1059
|
|
|
1060
|
+
|
|
1061
|
+
|
|
830
1062
|
</div>
|
|
831
1063
|
|
|
1064
|
+
|
|
1065
|
+
|
|
832
1066
|
</div>
|
|
833
1067
|
|
|
834
1068
|
## Functions
|
|
835
1069
|
|
|
1070
|
+
|
|
836
1071
|
### isHttpClientAbortError
|
|
837
1072
|
|
|
838
1073
|
<div class="padding-bottom--md">
|
|
@@ -840,18 +1075,30 @@ Represents a plain text field. No filename and content type is set.
|
|
|
840
1075
|
|
|
841
1076
|
<div class="padding-left--md">
|
|
842
1077
|
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
|
|
843
1082
|
</div>
|
|
844
1083
|
|
|
1084
|
+
|
|
845
1085
|
#### Parameters
|
|
846
1086
|
|
|
847
|
-
| Name
|
|
848
|
-
|
|
849
|
-
|
|
|
1087
|
+
| Name | Type|
|
|
1088
|
+
|---|---|
|
|
1089
|
+
|e<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
1090
|
+
|
|
1091
|
+
|
|
1092
|
+
|
|
1093
|
+
|
|
1094
|
+
|
|
850
1095
|
|
|
851
|
-
{/* no returns */}
|
|
852
1096
|
|
|
853
1097
|
</div>
|
|
854
1098
|
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
|
|
855
1102
|
### isHttpClientNetworkError
|
|
856
1103
|
|
|
857
1104
|
<div class="padding-bottom--md">
|
|
@@ -859,18 +1106,30 @@ Represents a plain text field. No filename and content type is set.
|
|
|
859
1106
|
|
|
860
1107
|
<div class="padding-left--md">
|
|
861
1108
|
|
|
1109
|
+
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
|
|
862
1113
|
</div>
|
|
863
1114
|
|
|
1115
|
+
|
|
864
1116
|
#### Parameters
|
|
865
1117
|
|
|
866
|
-
| Name
|
|
867
|
-
|
|
868
|
-
|
|
|
1118
|
+
| Name | Type|
|
|
1119
|
+
|---|---|
|
|
1120
|
+
|e<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
|
|
869
1126
|
|
|
870
|
-
{/* no returns */}
|
|
871
1127
|
|
|
872
1128
|
</div>
|
|
873
1129
|
|
|
1130
|
+
|
|
1131
|
+
|
|
1132
|
+
|
|
874
1133
|
### isHttpClientRequestError
|
|
875
1134
|
|
|
876
1135
|
<div class="padding-bottom--md">
|
|
@@ -878,18 +1137,30 @@ Represents a plain text field. No filename and content type is set.
|
|
|
878
1137
|
|
|
879
1138
|
<div class="padding-left--md">
|
|
880
1139
|
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
|
|
881
1144
|
</div>
|
|
882
1145
|
|
|
1146
|
+
|
|
883
1147
|
#### Parameters
|
|
884
1148
|
|
|
885
|
-
| Name
|
|
886
|
-
|
|
887
|
-
|
|
|
1149
|
+
| Name | Type|
|
|
1150
|
+
|---|---|
|
|
1151
|
+
|e<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
|
|
888
1157
|
|
|
889
|
-
{/* no returns */}
|
|
890
1158
|
|
|
891
1159
|
</div>
|
|
892
1160
|
|
|
1161
|
+
|
|
1162
|
+
|
|
1163
|
+
|
|
893
1164
|
### isHttpClientResponseError
|
|
894
1165
|
|
|
895
1166
|
<div class="padding-bottom--md">
|
|
@@ -897,14 +1168,26 @@ Represents a plain text field. No filename and content type is set.
|
|
|
897
1168
|
|
|
898
1169
|
<div class="padding-left--md">
|
|
899
1170
|
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
|
|
900
1175
|
</div>
|
|
901
1176
|
|
|
1177
|
+
|
|
902
1178
|
#### Parameters
|
|
903
1179
|
|
|
904
|
-
| Name
|
|
905
|
-
|
|
906
|
-
|
|
|
1180
|
+
| Name | Type|
|
|
1181
|
+
|---|---|
|
|
1182
|
+
|e<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
1183
|
+
|
|
1184
|
+
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
|
|
907
1188
|
|
|
908
|
-
{/* no returns */}
|
|
909
1189
|
|
|
910
1190
|
</div>
|
|
1191
|
+
|
|
1192
|
+
|
|
1193
|
+
|