springboot的版本最好用2.1.3RELEASE新版本会取不到第二个参数的值。
@RestController
public class testController {
@GetMapping("/test")
public void test(HttpServletResponse response) throws IOException {
response.sendError(HttpServletResponse.SC_BAD_REQUEST,"你的请求属于畸形请求!!");
}
}
访问路径:http://localhost:8080/test



