sveltekit-superforms icon indicating copy to clipboard operation
sveltekit-superforms copied to clipboard

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

Open amarezenebe opened this issue 1 year ago • 1 comments

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',

amarezenebe avatar Apr 17 '24 11:04 amarezenebe

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.

ciscoheat avatar Apr 19 '24 17:04 ciscoheat

This is possible now with customRequest!

ciscoheat avatar Oct 08 '24 10:10 ciscoheat