Post增(查询参数多是也用post) Delete删 Put改 get查
springboot配置默认拦截controller(自定义配置不会过滤css,js)
spring
#restful风格配置
mvc:
hiddenmethod:
filter:
enabled: true
js 使用put delete 都为 type都为post
controller为
@DeleteMapping("delete")
@PutMapping("update")
$.ajax({
url: '/hot/delete',
type: 'post',
dataType: 'JSON',
data: {
id:id,
_method: 'delete'
}
});
另一种为页面在表单里
<input type="hidden" name="_method" value="put"/>