-
-
Notifications
You must be signed in to change notification settings - Fork 660
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
Getting the following error:
Promise {
<rejected> NotSupportedError: multipart/form-data not supported
at Request.formData (node:internal/deps/undici/undici:2311:19)
Reproducible By
const formData = new FormData()
formData.append('username', 'john.maverick')
const req = new Request('http://localhost', {
method: 'POST',
body: formData,
})
console.log(req.formData())
This example uses Node.js globals for Fetch API so I'm not importing any polyfills for neither Request
nor FormData
.
Expected Behavior
Calling request.formData()
must return a Promise that resolves to a FormData
instance containing the fields initially supplied to the Request
constructor.
Logs & Screenshots
Environment
- Node 18.8.0
Additional context
I've skimmed Undici's source and couldn't find this NotSupportedError
instance. I suspect this was indeed unsupported in the past but has been implemented in the newer versions of Node? I'd like to know when this was added, if ever. Thanks.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working