af
af
CDCloudflare Developers
Created by af on 2/21/2025 in #workers-help
[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!");
}
};
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.
4 replies