Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
amarezenebe opened this issue Apr 17, 2024 · 1 comment
Open

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

amarezenebe opened this issue Apr 17, 2024 · 1 comment

Comments

@amarezenebe
Copy link

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 amarezenebe added the bug Something isn't working label Apr 17, 2024
@ciscoheat
Copy link
Owner

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 ciscoheat removed the bug Something isn't working label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants