ciscoheat / sveltekit-superforms

Making SvelteKit forms a pleasure to use!
https://superforms.rocks
MIT License
2.11k stars 62 forks source link

how to set additional header data when we submit the form ? #410

Open amarezenebe opened 4 months ago

amarezenebe commented 4 months ago

i want to set additional header data when i submit the form // method: 'POST', mode: 'cors', headers: { 'Content-Type': 'application/json', 'x-csrftoken': csrfcookie() } credentials: 'include',

ciscoheat commented 4 months ago

Superforms uses the SubmitFunction from SvelteKit in onSubmit, so I don't think this is possible. Extra data can be sent with formData or in the action URL instead.