SpringBoot how to use PUT, DELETE request method

SpringBoot 2.2.X not supported by default put, delete, etc. the requested method.

First need to open them in the configuration file, the code is as follows:

spring.mvc.hiddenmethod.filter.enabled=true

And then form the label inside the statement method to post

Finally, use the following tags in the form inside

<input th:type="hidden" name="_method" value="put">

name must be "_method", value is the value that you want to use the request method, put or delete, etc.

Guess you like

Origin www.cnblogs.com/lbhym/p/12089549.html