可以接两个RequestBody
时间: 2023-10-18 22:31:03 浏览: 85
可以接受两个RequestBody。在控制器层(Controller)的方法上,使用@RequestParam注解可以接受简单类型的属性,而使用@RequestBody注解可以接受对象类型的参数。在你提供的例子中,控制器方法上使用了两个@RequestBody注解,分别接受了Product和ProductOrder两个对象类型的参数。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [springboot后台接收axios传递的json数据为null](https://download.csdn.net/download/weixin_38616505/14916089)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [一个controller能同时使用两个@requestbody吗](https://blog.csdn.net/bryangp/article/details/112916495)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文