When I submit this form from Google Chrome, the browser makes a GET request. Are HTTP PUT requests submitted from HTML forms generally unsupported client-side?
<form id="#main-form" action="http://localhost:8080/resource/1" method="put"
enctype="multipart/form-data">
<input type="text" name="name"/>
<input type="submit" value="submit" />
</form>
Multipart/form-data is a special type of body that each value is sent as a block of data. Each part is separated by the defined delimiter (a.k.a boundary). The key value is described in the Content-Disposition header of each part. By using multipart/form-data, you can: Send a file or multiple files to your server.
The default content type/enctype is “application/x-www-form-urlencoded”. This is not efficient for sending large quantities of binary data or text containing non-ASCII characters. Multipart/form-data should be used for submitting forms that contain large files, non-ASCII data, and large binary data.
Multipart requests combine one or more sets of data into a single body, separated by boundaries. You typically use these requests for file uploads and for transferring data of several types in a single request (for example, a file along with a JSON object).
Multipart form data: The ENCTYPE attribute of <form> tag specifies the method of encoding for the form data. It is one of the two ways of encoding the HTML form. It is specifically used when file uploading is required in HTML form. It sends the form data to server in multiple parts because of large size of file.
The HTML markup language only support GET and POST requests, but you can make the other requests (PUT,DELETE,etc) with Ajax.
There are already answered questions about this: https://softwareengineering.stackexchange.com/questions/114156/why-there-are-no-put-and-delete-methods-in-html-forms
Why don't browsers support PUT and DELETE requests and when will they?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With