@RequestBody Required request body is missing
时间: 2023-08-17 08:14:58 浏览: 140
@RequestBody的使用详解
5星 · 资源好评率100%
回答: 当出现@RequestBody Required request body is missing异常时,这意味着在前端调用接口时没有传递请求主体的参数。这个异常是由于在代码中使用了@RequestBody注解,并且设置了required属性为true,表示请求主体内容是必需的。如果前端没有传递请求主体参数,就会抛出这个异常。\[2\]在接口文档测试时,可以传递空值作为请求主体参数,因为接口文档对接的并不是HTTP的传输方式。但是在实际前端对接时,如果没有传递请求主体参数给后端,就会报Required request body is missing异常。\[3\]因此,要解决这个异常,需要确保在前端调用接口时传递正确的请求主体参数。
#### 引用[.reference_title]
- *1* [Springboot--springmvc Required request body content is missing异常](https://blog.csdn.net/u014320421/article/details/78800856)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [“Required request body is missing”异常,要注意看看是不是下面这个问题](https://blog.csdn.net/weixin_61016066/article/details/125187074)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文