The solution
The PUT
method does not exist in HTML standards . The DELETE
also does not.
It's common to use this workaround :
<form method="post">
<input type="hidden" name="_method" value="put" />
...
</form>
Or make a XMLHttpRequest
with PUT
in client-side JavaScript.
Why are there no PUT and DELTE methods in HTML forms?
HTML5 sketches were considered to use the PUT
and DELETE
methods and were even implemented in the Firefox browser in its beta version.
Consider PUT and DELETE support as method
of form
was discussed in W3C and was closed as "resolved, but will not be fixed" for the following reason (translation and emphasis mine):
PUT as a method
of form
does not make any sense. You would not want a PUT in the payload of a form. DELETE only makes sense when there is payload , so it does not make sense in forms either.
On the day I write this, in 2018, HTML forms only support GET and POST.