Using PUT method in HTML form

后端 未结 7 2138
情话喂你
情话喂你 2020-11-22 11:30

Can I use a PUT method in an HTML form to send data from the form to a server?

7条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 11:46

    According to the HTML standard, you can not. The only valid values for the method attribute are get and post, corresponding to the GET and POST HTTP methods.

    is invalid HTML and will be treated like , i.e. send a GET request.

    Instead, many frameworks simply use a POST parameter to tunnel the HTTP method:

    
      
    ...
    

    Of course, this requires server-side unwrapping.

提交回复
热议问题