@RequestBody添加到String
时间: 2023-10-17 08:35:39 浏览: 97
day02.md
@RequestBody不能直接添加到String类型的参数上。@RequestBody注解通常用于接收请求体中的JSON数据,并将其转换为Java对象。在上述引用中的示例代码中,@RequestBody注解被添加到了MemberTagRelationQo类型的参数上,而不是String类型的参数上。这样做是因为在这个示例中,接收的请求体中的数据是以JSON格式传递的,并且需要将其转换为MemberTagRelationQo对象。如果要接收普通的String类型的参数,不需要使用@RequestBody注解。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [spirngmvc js传递复杂json参数到controller的实例](https://download.csdn.net/download/weixin_38647039/13618274)[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_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [postman使用@RequestBody的方式传递两个List<String>集合](https://blog.csdn.net/hecr_mingong/article/details/117957731)[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_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文