Required request body is missing
程序员文章站
2022-07-12 11:54:43
...
错误示范
@GetMapping("/listone")
public AjaxJson listone(@Valid @RequestBody DtDoctors dtDoctors){
return AjaxJson.success().put("",dtDoctors);
}
在测试这段代码的时候,一直报出Required request body is missing这个错。
然后开始查,RequestBody不支持GetMapping 将请求方式,我kao 一下就想起来了,以前学过的啊,记性是真的差。
还是老老实实写条SQL查吧
@GetMapping("doctorlist")
public AjaxJson doctorlist(){
List<DtDoctors> dtDoctors=this.dtDoctorsService.getdoctor();
return AjaxJson.success("").put("data",dtDoctors);
}
上一篇: java中static关键字详解。
下一篇: Apollo2.5源码阅读(1)
推荐阅读
-
Django在根据models生成数据库表时报 __init__() missing 1 required positional argument: 'on_delete'
-
golang复用http.request.body的方法示例
-
Spring Cloud Gateway 获取请求体(Request Body)的多种方法
-
ASP.NET Core读取Request.Body的正确方法
-
Required request body is missing 错误解决
-
400 Bad Request(Required String parameter ‘xxx‘ is not present)
-
打印HTTP request body和response body实现日志跟踪
-
Request Body数据读取
-
Required request body is missing
-
Java Web打印request body