[wrangler:err] TypeError: Parsing a Body as FormData requires a Content-Type header.

I believe this error is happening at request.formData() below and I'm just trying process the request from a basic html form with a few input fields and has theapplication/x-www-form-urlencoded content-type header, so I'm not sure why its throwing the error

export default {
    async fetch(request, env, ctx) {
        await request.formData().then(async (formData) => {
            console.log(formData);
        });
        return new Response("Message sent successfully!");
    }
};


Any advice would be appreciated.
Was this page helpful?