HTML forms do not support anything other than GET and POST. The value sent with the _method field will be used as the HTTP request method instead of POST:
<form action="/example" method="POST">
<input type="hidden" name="_method" value="PUT">
<!-- Rest of form -->
</form>
This will use PUT for the server-side routing instead of POST. The method inside the request object will stay the same, though.
The name was chosen as it is a pseudo-standard amongst various frameworks.
HTML forms do not support anything other than
GET
andPOST
. The value sent with the_method
field will be used as the HTTP request method instead of POST:This will use
PUT
for the server-side routing instead ofPOST
. The method inside the request object will stay the same, though.The name was chosen as it is a pseudo-standard amongst various frameworks.
See also: