You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Got 12, you can use spec-compliant [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) objects as request body, such as [`formdata-node`](https://github.com/octet-stream/form-data) or [`formdata-polyfill`](https://github.com/jimmywarting/FormData):
368
+
You can use [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) objects as request body:
369
369
370
370
```js
371
371
importgotfrom'got';
372
-
import {FormData} from'formdata-node'; // or:
373
-
// import {FormData} from 'formdata-polyfill/esm.min.js';
@@ -1634,7 +1633,7 @@ export default class Options {
1634
1633
1635
1634
__Note #4__: This option is not enumerable and will not be merged with the instance defaults.
1636
1635
1637
-
The `content-length` header will be automatically set if `body` is a `string` / `Buffer` / typed array ([`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), etc.) / [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) / [`form-data` instance](https://github.com/form-data/form-data), and `content-length` and `transfer-encoding` are not manually set in `options.headers`.
1636
+
The `content-length` header will be automatically set if `body` is a `string` / `Buffer` / typed array ([`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), etc.), and `content-length` and `transfer-encoding` are not manually set in `options.headers`.
1638
1637
1639
1638
Since Got 12, the `content-length` is not automatically set when `body` is a `fs.createReadStream`.
1640
1639
@@ -1655,12 +1654,12 @@ export default class Options {
0 commit comments