@naturalcycles/js-lib 14.121.0 → 14.122.0
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/dist/http/fetcher.d.ts
CHANGED
|
@@ -80,6 +80,12 @@ export interface FetcherOptions {
|
|
|
80
80
|
timeoutSeconds?: number;
|
|
81
81
|
json?: any;
|
|
82
82
|
text?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Supports all the types that RequestInit.body supports.
|
|
85
|
+
*
|
|
86
|
+
* Useful when you want to e.g pass FormData.
|
|
87
|
+
*/
|
|
88
|
+
body?: Blob | BufferSource | FormData | URLSearchParams | string;
|
|
83
89
|
credentials?: RequestCredentials;
|
|
84
90
|
headers?: Record<string, any>;
|
|
85
91
|
mode?: FetcherMode;
|
package/dist/http/fetcher.js
CHANGED
package/dist-esm/http/fetcher.js
CHANGED
package/package.json
CHANGED
package/src/http/fetcher.ts
CHANGED
|
@@ -103,8 +103,15 @@ export interface FetcherOptions {
|
|
|
103
103
|
* so both should finish within this single timeout (not each).
|
|
104
104
|
*/
|
|
105
105
|
timeoutSeconds?: number
|
|
106
|
+
|
|
106
107
|
json?: any
|
|
107
108
|
text?: string
|
|
109
|
+
/**
|
|
110
|
+
* Supports all the types that RequestInit.body supports.
|
|
111
|
+
*
|
|
112
|
+
* Useful when you want to e.g pass FormData.
|
|
113
|
+
*/
|
|
114
|
+
body?: Blob | BufferSource | FormData | URLSearchParams | string
|
|
108
115
|
|
|
109
116
|
credentials?: RequestCredentials
|
|
110
117
|
|
|
@@ -546,6 +553,8 @@ export class Fetcher {
|
|
|
546
553
|
} else if (opt.text !== undefined) {
|
|
547
554
|
req.init.body = opt.text
|
|
548
555
|
req.init.headers['content-type'] = 'text/plain'
|
|
556
|
+
} else if (opt.body !== undefined) {
|
|
557
|
+
req.init.body = opt.body
|
|
549
558
|
}
|
|
550
559
|
|
|
551
560
|
return req
|