The recursive option when set to true will enable recursion through all
nested objects and produce object[key] keys. It can be set to an array of
string to exclude specific keys.
Warning: Be careful to exclude Blob instances in the Browser, and
ReadableStream and Buffer instances when using the node.js compatible
form-data package.
// Will append the following keys to the FormData payload: // "duck", "duckProperties[beak][color]", "duckProperties[legs]" wretch("...").addons(FormDataAddon).formData(form, { recursive: ["ignored"] }).post();
Note: This addon does not support specifying a custom filename.
If you need to do so, you can use the body method directly:
Converts the javascript object to a FormData and sets the request body.
The
recursiveoption when set totruewill enable recursion through all nested objects and produceobject[key]keys. It can be set to an array of string to exclude specific keys.