@dynatrace-sdk/http-client 1.3.1 → 1.5.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 +23 -1
- package/cjs/index.js +22 -9
- package/docs/DOCS.md +191 -320
- package/esm/index.js +22 -9
- package/package.json +3 -5
- package/types/index.d.ts +617 -1
- package/types/packages/http-client/src/index.d.ts +0 -2
- package/types/packages/http-client/src/lib/platform/abort-controller.d.ts +0 -6
- package/types/packages/http-client/src/lib/platform/abort-signal.d.ts +0 -6
- package/types/packages/http-client/src/lib/platform/apply-content-type-header.d.ts +0 -2
- package/types/packages/http-client/src/lib/platform/base-error.d.ts +0 -5
- package/types/packages/http-client/src/lib/platform/binary.d.ts +0 -13
- package/types/packages/http-client/src/lib/platform/data-type-error.d.ts +0 -6
- package/types/packages/http-client/src/lib/platform/decode-form-data.d.ts +0 -48
- package/types/packages/http-client/src/lib/platform/decode-response-body.d.ts +0 -3
- package/types/packages/http-client/src/lib/platform/default-status-validator.d.ts +0 -2
- package/types/packages/http-client/src/lib/platform/encode-request-body.d.ts +0 -2
- package/types/packages/http-client/src/lib/platform/http-client-abort-error.d.ts +0 -7
- package/types/packages/http-client/src/lib/platform/http-client-request-error.d.ts +0 -7
- package/types/packages/http-client/src/lib/platform/http-client-response-error-serializer.d.ts +0 -3
- package/types/packages/http-client/src/lib/platform/http-client-response-error.d.ts +0 -11
- package/types/packages/http-client/src/lib/platform/http-client-response.d.ts +0 -10
- package/types/packages/http-client/src/lib/platform/http-client.d.ts +0 -24
- package/types/packages/http-client/src/lib/platform/index.d.ts +0 -12
- package/types/packages/http-client/src/lib/platform/oauth-http-client.d.ts +0 -41
- package/types/packages/http-client/src/lib/platform/unsupported-operation-error.d.ts +0 -6
- package/types/packages/http-client/src/lib/types/abort-controller.d.ts +0 -14
- package/types/packages/http-client/src/lib/types/abort-signal.d.ts +0 -18
- package/types/packages/http-client/src/lib/types/base-error.d.ts +0 -4
- package/types/packages/http-client/src/lib/types/binary.d.ts +0 -15
- package/types/packages/http-client/src/lib/types/data-type-error.d.ts +0 -14
- package/types/packages/http-client/src/lib/types/data-types.d.ts +0 -36
- package/types/packages/http-client/src/lib/types/form-data-request-body.d.ts +0 -83
- package/types/packages/http-client/src/lib/types/form-data-response-body.d.ts +0 -15
- package/types/packages/http-client/src/lib/types/headers.d.ts +0 -6
- package/types/packages/http-client/src/lib/types/http-client-abort-error.d.ts +0 -15
- package/types/packages/http-client/src/lib/types/http-client-network-error.d.ts +0 -15
- package/types/packages/http-client/src/lib/types/http-client-request-error.d.ts +0 -15
- package/types/packages/http-client/src/lib/types/http-client-request-options.d.ts +0 -42
- package/types/packages/http-client/src/lib/types/http-client-response-error.d.ts +0 -20
- package/types/packages/http-client/src/lib/types/http-client-response.d.ts +0 -33
- package/types/packages/http-client/src/lib/types/http-client.d.ts +0 -24
- package/types/packages/http-client/src/lib/types/index.d.ts +0 -20
- package/types/packages/http-client/src/lib/types/request-body-types.d.ts +0 -26
- package/types/packages/http-client/src/lib/types/response-body-types.d.ts +0 -46
- package/types/packages/http-client/src/lib/types/status-validator.d.ts +0 -7
- package/types/packages/http-client/src/lib/types/unsupported-operation-error.d.ts +0 -14
package/docs/DOCS.md
CHANGED
|
@@ -4,8 +4,6 @@ description: An environment agnostic (browser/deno vs nodejs) abstraction layer
|
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
# @dynatrace-sdk/http-client
|
|
8
|
-
|
|
9
7
|
An environment agnostic (browser/deno vs nodejs) abstraction layer for making HTTP calls.
|
|
10
8
|
|
|
11
9
|
import NpmLogo from '@site/static/img/npm-logo.png';
|
|
@@ -15,7 +13,7 @@ import NpmLogo from '@site/static/img/npm-logo.png';
|
|
|
15
13
|
<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>
|
|
16
14
|
</div>
|
|
17
15
|
<div class="col" style={{textAlign: 'right'}}>
|
|
18
|
-
<a href="https://www.npmjs.com/package/@dynatrace-sdk/http-client/v/1.
|
|
16
|
+
<a href="https://www.npmjs.com/package/@dynatrace-sdk/http-client/v/1.5.1" target="_blank" rel="noopener noreferrer">v1.5.1</a>
|
|
19
17
|
</div>
|
|
20
18
|
</div>
|
|
21
19
|
|
|
@@ -54,11 +52,6 @@ npm install @dynatrace-sdk/http-client
|
|
|
54
52
|
| Name | Type | Description |
|
|
55
53
|
| --- | --- | --- |
|
|
56
54
|
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)| |
|
|
57
|
-
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
58
|
-
|name<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
59
|
-
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
60
|
-
|prepareStackTrace|Object|Optional override for formatting stack traces |
|
|
61
|
-
|stackTraceLimit<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)| |
|
|
62
55
|
|
|
63
56
|
|
|
64
57
|
### PlatformBinary
|
|
@@ -99,6 +92,14 @@ Returns the binary data in a form that conforms to the specified type.
|
|
|
99
92
|
|
|
100
93
|
|
|
101
94
|
|
|
95
|
+
#### Throws
|
|
96
|
+
|
|
97
|
+
| Error Type | Error Message |
|
|
98
|
+
|---|---|
|
|
99
|
+
|DataTypeError|Data does not conform to the specified type.|
|
|
100
|
+
|UnsupportedOperationError|Type is not supported by the platform.|
|
|
101
|
+
|
|
102
|
+
|
|
102
103
|
|
|
103
104
|
|
|
104
105
|
</div>
|
|
@@ -133,6 +134,7 @@ Returns the binary data in a form that conforms to the specified type.
|
|
|
133
134
|
|
|
134
135
|
|
|
135
136
|
|
|
137
|
+
|
|
136
138
|
</div>
|
|
137
139
|
|
|
138
140
|
|
|
@@ -165,6 +167,7 @@ Returns the binary data in a form that conforms to the specified type.
|
|
|
165
167
|
|
|
166
168
|
|
|
167
169
|
|
|
170
|
+
|
|
168
171
|
</div>
|
|
169
172
|
|
|
170
173
|
|
|
@@ -197,6 +200,7 @@ Returns the binary data in a form that conforms to the specified type.
|
|
|
197
200
|
|
|
198
201
|
|
|
199
202
|
|
|
203
|
+
|
|
200
204
|
</div>
|
|
201
205
|
|
|
202
206
|
|
|
@@ -230,11 +234,7 @@ Returns the binary data in a form that conforms to the specified type.
|
|
|
230
234
|
| Name | Type | Description |
|
|
231
235
|
| --- | --- | --- |
|
|
232
236
|
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
233
|
-
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
234
237
|
|name<sup>*required</sup>|"DataTypeError"|The error name. |
|
|
235
|
-
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
236
|
-
|prepareStackTrace|Object|Optional override for formatting stack traces |
|
|
237
|
-
|stackTraceLimit<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)| |
|
|
238
238
|
|
|
239
239
|
|
|
240
240
|
### PlatformHttpClient
|
|
@@ -273,70 +273,6 @@ Currently, only the requests to the Platform Services and the Serverless Functio
|
|
|
273
273
|
|
|
274
274
|
|
|
275
275
|
|
|
276
|
-
##### _setBaseURL
|
|
277
|
-
|
|
278
|
-
<div class="padding-bottom--md">
|
|
279
|
-
<strong>_setBaseURL(baseUrl): void</strong>
|
|
280
|
-
|
|
281
|
-
<div class="padding-left--md">
|
|
282
|
-
|
|
283
|
-
Sets HTTP Client Instance baseUrl param to the incoming value `baseUrl`.
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
</div>
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
#### Parameters
|
|
291
|
-
|
|
292
|
-
| Name | Type | Description |
|
|
293
|
-
| --- | --- | --- |
|
|
294
|
-
|baseUrl<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|Base URL used in the request path. |
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
</div>
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
##### _setDefaultHeaders
|
|
309
|
-
|
|
310
|
-
<div class="padding-bottom--md">
|
|
311
|
-
<strong>_setDefaultHeaders(defaultHeaders): void</strong>
|
|
312
|
-
|
|
313
|
-
<div class="padding-left--md">
|
|
314
|
-
|
|
315
|
-
Sets HTTP Client Instance defaultHeaders param to the incoming value `defaultHeaders`.
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
</div>
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
#### Parameters
|
|
323
|
-
|
|
324
|
-
| Name | Type | Description |
|
|
325
|
-
| --- | --- | --- |
|
|
326
|
-
|defaultHeaders<sup>*required</sup>|[Headers](#headers)|HTTP Headers to be used in outgoing requests. |
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
</div>
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
276
|
##### send
|
|
341
277
|
|
|
342
278
|
<div class="padding-bottom--md">
|
|
@@ -368,7 +304,10 @@ when one of the following situations happen:
|
|
|
368
304
|
|
|
369
305
|
#### Returns
|
|
370
306
|
|
|
371
|
-
|
|
307
|
+
| Description |
|
|
308
|
+
|---|
|
|
309
|
+
|Promise<HttpClientResponse> A promise that resolves with the response object or rejects with an error.|
|
|
310
|
+
|
|
372
311
|
|
|
373
312
|
|
|
374
313
|
|
|
@@ -405,11 +344,7 @@ Represents a situation when the request was aborted.
|
|
|
405
344
|
| Name | Type | Description |
|
|
406
345
|
| --- | --- | --- |
|
|
407
346
|
|cause<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
408
|
-
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
409
347
|
|name<sup>*required</sup>|"AbortError"|The error name. |
|
|
410
|
-
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
411
|
-
|prepareStackTrace|Object|Optional override for formatting stack traces |
|
|
412
|
-
|stackTraceLimit<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)| |
|
|
413
348
|
|
|
414
349
|
|
|
415
350
|
### PlatformHttpClientRequestError
|
|
@@ -439,11 +374,7 @@ Represents a situation when the request is invalid and cannot be sent.
|
|
|
439
374
|
| Name | Type | Description |
|
|
440
375
|
| --- | --- | --- |
|
|
441
376
|
|cause<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
442
|
-
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
443
377
|
|name<sup>*required</sup>|"RequestError"|The error name. |
|
|
444
|
-
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
445
|
-
|prepareStackTrace|Object|Optional override for formatting stack traces |
|
|
446
|
-
|stackTraceLimit<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)| |
|
|
447
378
|
|
|
448
379
|
|
|
449
380
|
### PlatformHttpClientResponse
|
|
@@ -452,7 +383,7 @@ Represents the response to a request.
|
|
|
452
383
|
|
|
453
384
|
#### Constructors
|
|
454
385
|
|
|
455
|
-
##### new PlatformHttpClientResponse(response)
|
|
386
|
+
##### new PlatformHttpClientResponse(response,data?)
|
|
456
387
|
<div class="padding-left--md">
|
|
457
388
|
|
|
458
389
|
#### Parameters
|
|
@@ -460,6 +391,8 @@ Represents the response to a request.
|
|
|
460
391
|
| Name | Type |
|
|
461
392
|
| --- | --- |
|
|
462
393
|
|response<sup>*required</sup>|Response|
|
|
394
|
+
|data|\{ requestUrl \}|
|
|
395
|
+
|data.requestUrl<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
463
396
|
|
|
464
397
|
|
|
465
398
|
|
|
@@ -470,9 +403,10 @@ Represents the response to a request.
|
|
|
470
403
|
|
|
471
404
|
#### Properties
|
|
472
405
|
|
|
473
|
-
| Name | Type |
|
|
474
|
-
| --- | --- |
|
|
475
|
-
|
|
|
406
|
+
| Name | Type | Description |
|
|
407
|
+
| --- | --- | --- |
|
|
408
|
+
|requestUrl<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|The URL that was originally requested, before any redirects were followed. |
|
|
409
|
+
|response<sup>*required</sup>|Response| |
|
|
476
410
|
|
|
477
411
|
#### Accessors
|
|
478
412
|
|
|
@@ -489,7 +423,8 @@ The status message corresponding to the status code.
|
|
|
489
423
|
|
|
490
424
|
|
|
491
425
|
##### url
|
|
492
|
-
The URL of the response.
|
|
426
|
+
The URL of the response. May differ from `requestUrl` if the request was
|
|
427
|
+
redirected.
|
|
493
428
|
|
|
494
429
|
|
|
495
430
|
#### Methods
|
|
@@ -520,6 +455,14 @@ Returns the response body in a form that conforms to the specified response body
|
|
|
520
455
|
|
|
521
456
|
|
|
522
457
|
|
|
458
|
+
#### Throws
|
|
459
|
+
|
|
460
|
+
| Error Type | Error Message |
|
|
461
|
+
|---|---|
|
|
462
|
+
|DataTypeError|Response body does not conform to the specified response body type.|
|
|
463
|
+
|UnsupportedOperationError|Response body type is not supported by the platform.|
|
|
464
|
+
|
|
465
|
+
|
|
523
466
|
|
|
524
467
|
|
|
525
468
|
</div>
|
|
@@ -541,8 +484,9 @@ Represents a situation when the response status is considered invalid by the sta
|
|
|
541
484
|
| Name | Type |
|
|
542
485
|
| --- | --- |
|
|
543
486
|
|response<sup>*required</sup>|Response|
|
|
544
|
-
|data|
|
|
487
|
+
|data|\{ requestMethod, requestUrl \}|
|
|
545
488
|
|data.requestMethod|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
489
|
+
|data.requestUrl|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
546
490
|
|
|
547
491
|
|
|
548
492
|
|
|
@@ -556,13 +500,9 @@ Represents a situation when the response status is considered invalid by the sta
|
|
|
556
500
|
| Name | Type | Description |
|
|
557
501
|
| --- | --- | --- |
|
|
558
502
|
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
559
|
-
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
560
503
|
|name<sup>*required</sup>|"ResponseError"|The error name. |
|
|
561
504
|
|requestMethod|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
562
505
|
|response<sup>*required</sup>|[HttpClientResponse](#httpclientresponse)|The response. |
|
|
563
|
-
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
564
|
-
|prepareStackTrace|Object|Optional override for formatting stack traces |
|
|
565
|
-
|stackTraceLimit<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)| |
|
|
566
506
|
|
|
567
507
|
|
|
568
508
|
### PlatformUnsupportedOperationError
|
|
@@ -593,47 +533,54 @@ Represents a situation when the response status is considered invalid by the sta
|
|
|
593
533
|
| Name | Type | Description |
|
|
594
534
|
| --- | --- | --- |
|
|
595
535
|
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
596
|
-
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
597
536
|
|name<sup>*required</sup>|"UnsupportedOperationError"|The error name. |
|
|
598
|
-
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
599
|
-
|prepareStackTrace|Object|Optional override for formatting stack traces |
|
|
600
|
-
|stackTraceLimit<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)| |
|
|
601
537
|
|
|
602
538
|
|
|
603
|
-
|
|
604
|
-
DO NOT USE - internal use only.
|
|
539
|
+
## Functions
|
|
605
540
|
|
|
606
541
|
|
|
607
|
-
#### Constructors
|
|
608
542
|
|
|
609
|
-
|
|
543
|
+
### isHttpClientAbortError
|
|
544
|
+
|
|
545
|
+
<div class="padding-bottom--md">
|
|
546
|
+
<strong>isHttpClientAbortError(e): </strong>
|
|
610
547
|
|
|
548
|
+
<div class="padding-left--md">
|
|
611
549
|
|
|
612
550
|
|
|
613
|
-
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
</div>
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
#### Parameters
|
|
614
558
|
|
|
615
559
|
| Name | Type |
|
|
616
560
|
| --- | --- |
|
|
617
|
-
|
|
|
561
|
+
|e<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
618
562
|
|
|
619
|
-
#### Methods
|
|
620
563
|
|
|
621
564
|
|
|
622
565
|
|
|
623
|
-
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
</div>
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
### isHttpClientNetworkError
|
|
624
577
|
|
|
625
578
|
<div class="padding-bottom--md">
|
|
626
|
-
<strong>
|
|
579
|
+
<strong>isHttpClientNetworkError(e): </strong>
|
|
627
580
|
|
|
628
581
|
<div class="padding-left--md">
|
|
629
582
|
|
|
630
|
-
|
|
631
|
-
Returns a promise that resolves with a response object for successful requests or rejects with an appropriate error
|
|
632
|
-
when one of the following situations happen:
|
|
633
|
-
- `DataTypeError` - request body does not conform to the specified request body type,
|
|
634
|
-
- `HttpClientRequestError` - request cannot be sent (e.g. due to network error or invalid request),
|
|
635
|
-
- `HttpClientResponseError` - response status is considered invalid by the status validator,
|
|
636
|
-
- `HttpClientAbortError` - request was aborted.
|
|
583
|
+
|
|
637
584
|
|
|
638
585
|
|
|
639
586
|
|
|
@@ -642,16 +589,46 @@ when one of the following situations happen:
|
|
|
642
589
|
|
|
643
590
|
#### Parameters
|
|
644
591
|
|
|
645
|
-
| Name | Type |
|
|
646
|
-
| --- | --- |
|
|
647
|
-
|
|
|
592
|
+
| Name | Type |
|
|
593
|
+
| --- | --- |
|
|
594
|
+
|e<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
648
595
|
|
|
649
596
|
|
|
650
597
|
|
|
651
598
|
|
|
652
|
-
#### Returns
|
|
653
599
|
|
|
654
|
-
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
</div>
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
### isHttpClientRequestError
|
|
610
|
+
|
|
611
|
+
<div class="padding-bottom--md">
|
|
612
|
+
<strong>isHttpClientRequestError(e): </strong>
|
|
613
|
+
|
|
614
|
+
<div class="padding-left--md">
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
</div>
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
#### Parameters
|
|
624
|
+
|
|
625
|
+
| Name | Type |
|
|
626
|
+
| --- | --- |
|
|
627
|
+
|e<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
655
632
|
|
|
656
633
|
|
|
657
634
|
|
|
@@ -661,7 +638,77 @@ Promise&lt;HttpClientResponse&gt; A promise that resolves with the respo
|
|
|
661
638
|
|
|
662
639
|
|
|
663
640
|
|
|
664
|
-
|
|
641
|
+
|
|
642
|
+
### isHttpClientResponseError
|
|
643
|
+
|
|
644
|
+
<div class="padding-bottom--md">
|
|
645
|
+
<strong>isHttpClientResponseError(e): </strong>
|
|
646
|
+
|
|
647
|
+
<div class="padding-left--md">
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
</div>
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
#### Parameters
|
|
657
|
+
|
|
658
|
+
| Name | Type |
|
|
659
|
+
| --- | --- |
|
|
660
|
+
|e<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
</div>
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
## Constants
|
|
674
|
+
|
|
675
|
+
### PlatformAbortController
|
|
676
|
+
<div class="padding-left--md">
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
</div>
|
|
681
|
+
|
|
682
|
+
<div class="padding-left--md">
|
|
683
|
+
() => [AbortController](#abortcontroller)
|
|
684
|
+
|
|
685
|
+
</div>
|
|
686
|
+
|
|
687
|
+
### PlatformAbortSignal
|
|
688
|
+
<div class="padding-left--md">
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
</div>
|
|
693
|
+
|
|
694
|
+
<div class="padding-left--md">
|
|
695
|
+
() => AbortSignal
|
|
696
|
+
|
|
697
|
+
</div>
|
|
698
|
+
|
|
699
|
+
### httpClient
|
|
700
|
+
<div class="padding-left--md">
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
</div>
|
|
705
|
+
|
|
706
|
+
<div class="padding-left--md">
|
|
707
|
+
[HttpClient](#httpclient)
|
|
708
|
+
|
|
709
|
+
</div>
|
|
710
|
+
|
|
711
|
+
## Types
|
|
665
712
|
|
|
666
713
|
### AbortController
|
|
667
714
|
Represents a controller object that allows to abort one or more requests as and when desired.
|
|
@@ -695,6 +742,7 @@ Aborts a request before it has completed.
|
|
|
695
742
|
|
|
696
743
|
|
|
697
744
|
|
|
745
|
+
|
|
698
746
|
</div>
|
|
699
747
|
|
|
700
748
|
|
|
@@ -709,9 +757,7 @@ Aborts a request before it has completed.
|
|
|
709
757
|
| Name | Type |
|
|
710
758
|
| --- | --- |
|
|
711
759
|
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
712
|
-
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
713
760
|
|name<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
714
|
-
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
715
761
|
|
|
716
762
|
|
|
717
763
|
### Binary
|
|
@@ -746,6 +792,14 @@ Returns the binary data in a form that conforms to the specified type.
|
|
|
746
792
|
|
|
747
793
|
|
|
748
794
|
|
|
795
|
+
#### Throws
|
|
796
|
+
|
|
797
|
+
| Error Type | Error Message |
|
|
798
|
+
|---|---|
|
|
799
|
+
|DataTypeError|Data does not conform to the specified type.|
|
|
800
|
+
|UnsupportedOperationError|Type is not supported by the platform.|
|
|
801
|
+
|
|
802
|
+
|
|
749
803
|
|
|
750
804
|
|
|
751
805
|
</div>
|
|
@@ -792,9 +846,7 @@ Represents an binary field.
|
|
|
792
846
|
| Name | Type | Description |
|
|
793
847
|
| --- | --- | --- |
|
|
794
848
|
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
795
|
-
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
796
849
|
|name<sup>*required</sup>|"DataTypeError"|The error name. |
|
|
797
|
-
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
798
850
|
|
|
799
851
|
|
|
800
852
|
### Headers
|
|
@@ -843,7 +895,10 @@ when one of the following situations happen:
|
|
|
843
895
|
|
|
844
896
|
#### Returns
|
|
845
897
|
|
|
846
|
-
|
|
898
|
+
| Description |
|
|
899
|
+
|---|
|
|
900
|
+
|Promise<HttpClientResponse> A promise that resolves with the response object or rejects with an error.|
|
|
901
|
+
|
|
847
902
|
|
|
848
903
|
|
|
849
904
|
|
|
@@ -862,9 +917,7 @@ Represents a situation when the request was aborted.
|
|
|
862
917
|
| Name | Type | Description |
|
|
863
918
|
| --- | --- | --- |
|
|
864
919
|
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
865
|
-
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
866
920
|
|name<sup>*required</sup>|"AbortError"|The error name. |
|
|
867
|
-
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
868
921
|
|
|
869
922
|
|
|
870
923
|
### HttpClientNetworkError
|
|
@@ -876,9 +929,7 @@ Represents a situation when a network error occurred.
|
|
|
876
929
|
| Name | Type | Description |
|
|
877
930
|
| --- | --- | --- |
|
|
878
931
|
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
879
|
-
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
880
932
|
|name<sup>*required</sup>|"NetworkError"|The error name. |
|
|
881
|
-
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
882
933
|
|
|
883
934
|
|
|
884
935
|
### HttpClientRequestError
|
|
@@ -890,9 +941,7 @@ Represents a situation when the request is invalid and cannot be sent.
|
|
|
890
941
|
| Name | Type | Description |
|
|
891
942
|
| --- | --- | --- |
|
|
892
943
|
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
893
|
-
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
894
944
|
|name<sup>*required</sup>|"RequestError"|The error name. |
|
|
895
|
-
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
896
945
|
|
|
897
946
|
|
|
898
947
|
### HttpClientRequestOptions
|
|
@@ -920,9 +969,10 @@ Represents the response to a request.
|
|
|
920
969
|
| Name | Type | Description |
|
|
921
970
|
| --- | --- | --- |
|
|
922
971
|
|headers<sup>*required</sup>|[Headers](#headers)|The response headers. |
|
|
972
|
+
|requestUrl<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|The URL that was originally requested, before any redirects were followed. |
|
|
923
973
|
|status<sup>*required</sup>|[number](https://developer.mozilla.org/en-US/docs/Glossary/Number)|The status code of the response. |
|
|
924
974
|
|statusText<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|The status message corresponding to the status code. |
|
|
925
|
-
|url<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)
|
|
975
|
+
|url<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|<p>The URL of the response. May differ from <code>requestUrl</code> if the request was redirected.</p> |
|
|
926
976
|
|
|
927
977
|
#### Methods
|
|
928
978
|
|
|
@@ -952,6 +1002,14 @@ Returns the response body in a form that conforms to the specified response body
|
|
|
952
1002
|
|
|
953
1003
|
|
|
954
1004
|
|
|
1005
|
+
#### Throws
|
|
1006
|
+
|
|
1007
|
+
| Error Type | Error Message |
|
|
1008
|
+
|---|---|
|
|
1009
|
+
|DataTypeError|Response body does not conform to the specified response body type.|
|
|
1010
|
+
|UnsupportedOperationError|Response body type is not supported by the platform.|
|
|
1011
|
+
|
|
1012
|
+
|
|
955
1013
|
|
|
956
1014
|
|
|
957
1015
|
</div>
|
|
@@ -968,10 +1026,8 @@ Represents a situation when the response status is considered invalid by the sta
|
|
|
968
1026
|
| Name | Type | Description |
|
|
969
1027
|
| --- | --- | --- |
|
|
970
1028
|
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
971
|
-
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
972
1029
|
|name<sup>*required</sup>|"ResponseError"|The error name. |
|
|
973
1030
|
|response<sup>*required</sup>|[HttpClientResponse](#httpclientresponse)|The response. |
|
|
974
|
-
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
975
1031
|
|
|
976
1032
|
|
|
977
1033
|
### JsonFormDataRequestField
|
|
@@ -1029,191 +1085,6 @@ Represents a plain text field. No filename and content type is set.
|
|
|
1029
1085
|
| Name | Type | Description |
|
|
1030
1086
|
| --- | --- | --- |
|
|
1031
1087
|
|cause|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|The error root cause. |
|
|
1032
|
-
|message<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
1033
1088
|
|name<sup>*required</sup>|"UnsupportedOperationError"|The error name. |
|
|
1034
|
-
|stack|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)| |
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
### _OAuthHttpClientConfig
|
|
1038
|
-
DO NOT USE - internal use only.
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
#### Properties
|
|
1042
|
-
|
|
1043
|
-
| Name | Type |
|
|
1044
|
-
| --- | --- |
|
|
1045
|
-
|authUrl<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
1046
|
-
|clientId<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
1047
|
-
|environmentUrl<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
1048
|
-
|scopes<sup>*required</sup>|Array<[string](https://developer.mozilla.org/en-US/docs/Glossary/String)>|
|
|
1049
|
-
|secret<sup>*required</sup>|[string](https://developer.mozilla.org/en-US/docs/Glossary/String)|
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
## Variables
|
|
1053
|
-
|
|
1054
|
-
<div class="padding-left--md padding-bottom--md">
|
|
1055
|
-
<strong>PlatformAbortController</strong>: Object
|
|
1056
|
-
<div class="padding-left--md">
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
</div>
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
</div>
|
|
1065
|
-
|
|
1066
|
-
<div class="padding-left--md padding-bottom--md">
|
|
1067
|
-
<strong>PlatformAbortSignal</strong>: Object
|
|
1068
|
-
<div class="padding-left--md">
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
</div>
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
</div>
|
|
1077
|
-
|
|
1078
|
-
<div class="padding-left--md padding-bottom--md">
|
|
1079
|
-
<strong>httpClient</strong>: [HttpClient](#httpclient)
|
|
1080
|
-
<div class="padding-left--md">
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
</div>
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
</div>
|
|
1089
|
-
|
|
1090
|
-
## Functions
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
### isHttpClientAbortError
|
|
1095
|
-
|
|
1096
|
-
<div class="padding-bottom--md">
|
|
1097
|
-
<strong>isHttpClientAbortError(e): </strong>
|
|
1098
|
-
|
|
1099
|
-
<div class="padding-left--md">
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
</div>
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
#### Parameters
|
|
1109
|
-
|
|
1110
|
-
| Name | Type |
|
|
1111
|
-
| --- | --- |
|
|
1112
|
-
|e<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
</div>
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
### isHttpClientNetworkError
|
|
1127
|
-
|
|
1128
|
-
<div class="padding-bottom--md">
|
|
1129
|
-
<strong>isHttpClientNetworkError(e): </strong>
|
|
1130
|
-
|
|
1131
|
-
<div class="padding-left--md">
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
</div>
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
#### Parameters
|
|
1141
|
-
|
|
1142
|
-
| Name | Type |
|
|
1143
|
-
| --- | --- |
|
|
1144
|
-
|e<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
</div>
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
### isHttpClientRequestError
|
|
1159
|
-
|
|
1160
|
-
<div class="padding-bottom--md">
|
|
1161
|
-
<strong>isHttpClientRequestError(e): </strong>
|
|
1162
|
-
|
|
1163
|
-
<div class="padding-left--md">
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
</div>
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
#### Parameters
|
|
1173
|
-
|
|
1174
|
-
| Name | Type |
|
|
1175
|
-
| --- | --- |
|
|
1176
|
-
|e<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
</div>
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
### isHttpClientResponseError
|
|
1191
|
-
|
|
1192
|
-
<div class="padding-bottom--md">
|
|
1193
|
-
<strong>isHttpClientResponseError(e): </strong>
|
|
1194
|
-
|
|
1195
|
-
<div class="padding-left--md">
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
</div>
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
#### Parameters
|
|
1205
|
-
|
|
1206
|
-
| Name | Type |
|
|
1207
|
-
| --- | --- |
|
|
1208
|
-
|e<sup>*required</sup>|[any](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any)|
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
</div>
|
|
1217
|
-
|
|
1218
1089
|
|
|
1219
1090
|
|