79208899

Date: 2024-11-20 20:47:26
Score: 1.5
Natty:
Report link

what if I don't have a real html form at all with my Svelte frontend, just a collection of some input boxes and a button where I want to submit those inputs to one of the actions exported from +page.server.js file, i.e edit?

<button onclick={(e) => {
const response = await fetch("?/edit", {
  method: "PUT",
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(formData),
});
}} >Confirm</button>

I tried it, but I've got 405 Method Not Allowed although the edit action does have PUT as its method

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): what if I
  • Low reputation (0.5):
Posted by: Sam D.