springboot处理put请求

tech2022-08-01  143

springboot处理put请求

路径注解

@PutMapping

接收参数注解

@PathVariable //注意value的值必须与路径的值一样

示例:

@PutMapping("users/{uId}/state/{type}") public ReturnVo setUserState(@PathVariable("uId") Integer uId,@PathVariable("type") Boolean type)

请求路径

http://localhost:8889/api/users/1/state/true

最新回复(0)