@dynatrace-sdk/http-client 1.0.5 → 1.0.7
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/docs/DOCS.md +55 -53
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
package/docs/DOCS.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: @dynatrace-sdk/http-client
|
|
3
|
-
description:
|
|
2
|
+
title: "@dynatrace-sdk/http-client"
|
|
3
|
+
description: An environment agnostic (browser/deno vs nodejs) abstraction layer for making HTTP calls.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# @dynatrace-sdk/http-client
|
|
7
7
|
|
|
8
|
+
An environment agnostic (browser/deno vs nodejs) abstraction layer for making HTTP calls.
|
|
9
|
+
|
|
8
10
|
import NpmLogo from '@site/static/img/npm-logo.png';
|
|
9
11
|
|
|
10
12
|
<div class="row margin-bottom--md">
|
|
@@ -15,7 +17,7 @@ import NpmLogo from '@site/static/img/npm-logo.png';
|
|
|
15
17
|
</a>
|
|
16
18
|
</div>
|
|
17
19
|
<div class="col" style={{textAlign: 'right'}}>
|
|
18
|
-
<a href="https://www.npmjs.com/package/@dynatrace-sdk/http-client/v/1.0.
|
|
20
|
+
<a href="https://www.npmjs.com/package/@dynatrace-sdk/http-client/v/1.0.7">v1.0.7</a>
|
|
19
21
|
</div>
|
|
20
22
|
</div>
|
|
21
23
|
|
|
@@ -63,16 +65,16 @@ Represents an environment agnostic (browser vs node) abstraction layer for binar
|
|
|
63
65
|
|
|
64
66
|
#### Properties
|
|
65
67
|
|
|
66
|
-
| Name | Type
|
|
67
|
-
| ------------------------- |
|
|
68
|
-
| data<sup>\*required</sup> |
|
|
68
|
+
| Name | Type |
|
|
69
|
+
| ------------------------- | --------------------------------------------------------------- |
|
|
70
|
+
| data<sup>\*required</sup> | ArrayBuffer | Blob | ReadableStream<Uint8Array> |
|
|
69
71
|
|
|
70
72
|
#### Methods
|
|
71
73
|
|
|
72
74
|
##### get
|
|
73
75
|
|
|
74
76
|
<div class="padding-bottom--md">
|
|
75
|
-
<strong>get(type):
|
|
77
|
+
<strong>get(type): DataTypes<T></strong>
|
|
76
78
|
|
|
77
79
|
<div class="padding-left--md">
|
|
78
80
|
|
|
@@ -82,9 +84,9 @@ Returns the binary data in a form that conforms to the specified type.
|
|
|
82
84
|
|
|
83
85
|
#### Parameters
|
|
84
86
|
|
|
85
|
-
| Name | Type
|
|
86
|
-
| ------------------------- |
|
|
87
|
-
| type<sup>\*required</sup> |
|
|
87
|
+
| Name | Type | Description |
|
|
88
|
+
| ------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
89
|
+
| 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> |
|
|
88
90
|
|
|
89
91
|
<!-- no returns -->
|
|
90
92
|
|
|
@@ -101,9 +103,9 @@ Returns the binary data in a form that conforms to the specified type.
|
|
|
101
103
|
|
|
102
104
|
#### Parameters
|
|
103
105
|
|
|
104
|
-
| Name | Type
|
|
105
|
-
| ------------------------- |
|
|
106
|
-
| data<sup>\*required</sup> |
|
|
106
|
+
| Name | Type |
|
|
107
|
+
| ------------------------- | --------------------------------------------------------------------------------------------- |
|
|
108
|
+
| data<sup>\*required</sup> | ArrayBuffer | Blob | ReadableStream<Uint8Array> | Buffer | Readable |
|
|
107
109
|
|
|
108
110
|
<!-- no returns -->
|
|
109
111
|
|
|
@@ -201,7 +203,7 @@ Currently, only the requests to the Platform Services and the Serverless Functio
|
|
|
201
203
|
##### send
|
|
202
204
|
|
|
203
205
|
<div class="padding-bottom--md">
|
|
204
|
-
<strong>send(options):
|
|
206
|
+
<strong>send(options): Promise<<a href="#httpclientresponse">HttpClientResponse</a>></strong>
|
|
205
207
|
|
|
206
208
|
<div class="padding-left--md">
|
|
207
209
|
|
|
@@ -218,13 +220,13 @@ when one of the following situations happen:
|
|
|
218
220
|
|
|
219
221
|
#### Parameters
|
|
220
222
|
|
|
221
|
-
| Name | Type
|
|
222
|
-
| ---------------------------- |
|
|
223
|
-
| options<sup>\*required</sup> | <a href="#httpclientrequestoptions">HttpClientRequestOptions</a><
|
|
223
|
+
| Name | Type | Description |
|
|
224
|
+
| ---------------------------- | ------------------------------------------------------------------------- | -------------------------------------- |
|
|
225
|
+
| options<sup>\*required</sup> | <a href="#httpclientrequestoptions">HttpClientRequestOptions</a><T> | Options used to configure the request. |
|
|
224
226
|
|
|
225
227
|
#### Returns
|
|
226
228
|
|
|
227
|
-
Promise
|
|
229
|
+
Promise<HttpClientResponse> A promise that resolves with the response object or rejects with an error.
|
|
228
230
|
|
|
229
231
|
</div>
|
|
230
232
|
|
|
@@ -304,17 +306,17 @@ Represents the response to a request.
|
|
|
304
306
|
|
|
305
307
|
#### Parameters
|
|
306
308
|
|
|
307
|
-
| Name | Type
|
|
308
|
-
| ----------------------------- |
|
|
309
|
-
| response<sup>\*required</sup> |
|
|
309
|
+
| Name | Type |
|
|
310
|
+
| ----------------------------- | -------- |
|
|
311
|
+
| response<sup>\*required</sup> | Response |
|
|
310
312
|
|
|
311
313
|
</div>
|
|
312
314
|
|
|
313
315
|
#### Properties
|
|
314
316
|
|
|
315
|
-
| Name | Type
|
|
316
|
-
| ----------------------------- |
|
|
317
|
-
| response<sup>\*required</sup> |
|
|
317
|
+
| Name | Type |
|
|
318
|
+
| ----------------------------- | -------- |
|
|
319
|
+
| response<sup>\*required</sup> | Response |
|
|
318
320
|
|
|
319
321
|
#### Accessors
|
|
320
322
|
|
|
@@ -347,7 +349,7 @@ The URL of the response.
|
|
|
347
349
|
##### body
|
|
348
350
|
|
|
349
351
|
<div class="padding-bottom--md">
|
|
350
|
-
<strong>body(responseBodyType):
|
|
352
|
+
<strong>body(responseBodyType): ResponseBodyTypes<T></strong>
|
|
351
353
|
|
|
352
354
|
<div class="padding-left--md">
|
|
353
355
|
|
|
@@ -357,9 +359,9 @@ Returns the response body in a form that conforms to the specified response body
|
|
|
357
359
|
|
|
358
360
|
#### Parameters
|
|
359
361
|
|
|
360
|
-
| Name | Type
|
|
361
|
-
| ------------------------------------- |
|
|
362
|
-
| responseBodyType<sup>\*required</sup> |
|
|
362
|
+
| Name | Type | Description |
|
|
363
|
+
| ------------------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
364
|
+
| 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> |
|
|
363
365
|
|
|
364
366
|
<!-- no returns -->
|
|
365
367
|
|
|
@@ -379,9 +381,9 @@ Represents a situation when the response status is considered invalid by the sta
|
|
|
379
381
|
|
|
380
382
|
#### Parameters
|
|
381
383
|
|
|
382
|
-
| Name | Type
|
|
383
|
-
| ----------------------------- |
|
|
384
|
-
| response<sup>\*required</sup> |
|
|
384
|
+
| Name | Type |
|
|
385
|
+
| ----------------------------- | -------- |
|
|
386
|
+
| response<sup>\*required</sup> | Response |
|
|
385
387
|
|
|
386
388
|
</div>
|
|
387
389
|
|
|
@@ -515,7 +517,7 @@ Represents an environment agnostic (browser vs node) abstraction layer for binar
|
|
|
515
517
|
##### get
|
|
516
518
|
|
|
517
519
|
<div class="padding-bottom--md">
|
|
518
|
-
<strong>get(type):
|
|
520
|
+
<strong>get(type): DataTypes<T></strong>
|
|
519
521
|
|
|
520
522
|
<div class="padding-left--md">
|
|
521
523
|
|
|
@@ -525,9 +527,9 @@ Returns the binary data in a form that conforms to the specified type.
|
|
|
525
527
|
|
|
526
528
|
#### Parameters
|
|
527
529
|
|
|
528
|
-
| Name | Type
|
|
529
|
-
| ------------------------- |
|
|
530
|
-
| type<sup>\*required</sup> |
|
|
530
|
+
| Name | Type | Description |
|
|
531
|
+
| ------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
532
|
+
| 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> |
|
|
531
533
|
|
|
532
534
|
<!-- no returns -->
|
|
533
535
|
|
|
@@ -541,13 +543,13 @@ Represents an binary field.
|
|
|
541
543
|
|
|
542
544
|
#### Properties
|
|
543
545
|
|
|
544
|
-
| Name | Type
|
|
545
|
-
| -------------------------- |
|
|
546
|
-
| contentType | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a>
|
|
547
|
-
| filename | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a>
|
|
548
|
-
| name<sup>\*required</sup> | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a>
|
|
549
|
-
| type<sup>\*required</sup> | "binary"
|
|
550
|
-
| value<sup>\*required</sup> |
|
|
546
|
+
| Name | Type | Description |
|
|
547
|
+
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
548
|
+
| contentType | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | <p>The content type of the data contained in <code>value</code>. The default content type for the binary is 'application/octet-stream'.</p> |
|
|
549
|
+
| filename | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | <p>The filename reported to the server. The default filename for the binary is 'binary'.</p> |
|
|
550
|
+
| name<sup>\*required</sup> | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The name of the field. |
|
|
551
|
+
| type<sup>\*required</sup> | "binary" | A binary field type discriminator. |
|
|
552
|
+
| value<sup>\*required</sup> | ArrayBuffer | Blob | Buffer | Readable | <a href="#binary">Binary</a> | ReadableStream<<a href="https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any">any</a>> | File | The field's value. |
|
|
551
553
|
|
|
552
554
|
### BinaryFormDataResponseField
|
|
553
555
|
|
|
@@ -596,7 +598,7 @@ Currently, only the requests to the Platform Services and the Serverless Functio
|
|
|
596
598
|
##### send
|
|
597
599
|
|
|
598
600
|
<div class="padding-bottom--md">
|
|
599
|
-
<strong>send(options):
|
|
601
|
+
<strong>send(options): Promise<<a href="#httpclientresponse">HttpClientResponse</a>></strong>
|
|
600
602
|
|
|
601
603
|
<div class="padding-left--md">
|
|
602
604
|
|
|
@@ -613,13 +615,13 @@ when one of the following situations happen:
|
|
|
613
615
|
|
|
614
616
|
#### Parameters
|
|
615
617
|
|
|
616
|
-
| Name | Type
|
|
617
|
-
| ---------------------------- |
|
|
618
|
-
| options<sup>\*required</sup> | <a href="#httpclientrequestoptions">HttpClientRequestOptions</a><
|
|
618
|
+
| Name | Type | Description |
|
|
619
|
+
| ---------------------------- | ------------------------------------------------------------------------- | -------------------------------------- |
|
|
620
|
+
| options<sup>\*required</sup> | <a href="#httpclientrequestoptions">HttpClientRequestOptions</a><T> | Options used to configure the request. |
|
|
619
621
|
|
|
620
622
|
#### Returns
|
|
621
623
|
|
|
622
|
-
Promise
|
|
624
|
+
Promise<HttpClientResponse> A promise that resolves with the response object or rejects with an error.
|
|
623
625
|
|
|
624
626
|
</div>
|
|
625
627
|
|
|
@@ -678,10 +680,10 @@ Represents the options used to configure the request.
|
|
|
678
680
|
|
|
679
681
|
| Name | Type | Description |
|
|
680
682
|
| ------------------------ | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
681
|
-
| body |
|
|
683
|
+
| 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> |
|
|
682
684
|
| headers | <a href="#headers">Headers</a> | The request headers. |
|
|
683
685
|
| method | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The request method, e.g. <code>GET</code>, <code>POST</code>. |
|
|
684
|
-
| requestBodyType |
|
|
686
|
+
| 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> |
|
|
685
687
|
| statusValidator | <a href="#statusvalidator">StatusValidator</a> | <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> |
|
|
686
688
|
| url<sup>\*required</sup> | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The URL of the resource to fetch. |
|
|
687
689
|
|
|
@@ -705,7 +707,7 @@ Represents the response to a request.
|
|
|
705
707
|
##### body
|
|
706
708
|
|
|
707
709
|
<div class="padding-bottom--md">
|
|
708
|
-
<strong>body(responseBodyType?):
|
|
710
|
+
<strong>body(responseBodyType?): ResponseBodyTypes<T></strong>
|
|
709
711
|
|
|
710
712
|
<div class="padding-left--md">
|
|
711
713
|
|
|
@@ -715,9 +717,9 @@ Returns the response body in a form that conforms to the specified response body
|
|
|
715
717
|
|
|
716
718
|
#### Parameters
|
|
717
719
|
|
|
718
|
-
| Name | Type
|
|
719
|
-
| ---------------- |
|
|
720
|
-
| responseBodyType |
|
|
720
|
+
| Name | Type | Description |
|
|
721
|
+
| ---------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
722
|
+
| 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> |
|
|
721
723
|
|
|
722
724
|
<!-- no returns -->
|
|
723
725
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynatrace-sdk/http-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"description": "An environment agnostic (browser/deno vs nodejs) abstraction layer for making HTTP calls.",
|
|
4
5
|
"license": "Apache-2.0",
|
|
5
6
|
"dependencies": {
|
|
6
7
|
"@dynatrace-sdk/error-handlers": "^1.1.0"
|