Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do Browsers support PUT requests with multipart/form data [duplicate]

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>     
like image 998
supershnee Avatar asked May 19 '14 23:05

supershnee


People also ask

What is multipart form data in HTTP?

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.

Should I use multipart form data?

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.

When would you use a multipart?

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).

How multipart form data is sent?

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.


1 Answers

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?

like image 194
Thelight52 Avatar answered Oct 03 '22 03:10

Thelight52