Skip to content

Commit e2f268c

Browse files
committed
Add documentation for encoder options.
1 parent c4a64e0 commit e2f268c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

readme.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,12 @@ await fetch("https://httpbin.org/post", options)
306306

307307
### `class FormDataEncoder`
308308

309-
##### `constructor(form[, boundary]) -> {Encoder}`
309+
##### `constructor(form[, boundary, options]) -> {Encoder}`
310310

311311
- **{FormDataLike}** form - FormData object to encode. This object must be a spec-compatible FormData implementation.
312-
- **{string}** boundary - An optional boundary string that will be used by the encoder. If there's no boundary string is present, Encoder will generate it automatically.
312+
- **{string}** [boundary] - An optional boundary string that will be used by the encoder. If there's no boundary string is present, Encoder will generate it automatically.
313+
- **{object}** [options] - Encoder options.
314+
- **{boolean}** [options.enableAdditionalHeaders = false] - When enabled, the encoder will emit additional per part headers, such as `Content-Length`. Please note that the web clients do not include these, so when enabled this option might cause an error if `multipart/form-data` does not consider additional headers.
313315

314316
Creates a multipart/form-data encoder.
315317

0 commit comments

Comments
 (0)