postman中@RequestBody传参
时间: 2023-09-28 16:07:00 浏览: 210
在Postman中使用@RequestBody传递参数时,首先需要选择POST请求方式。然后,在请求的Body部分选择"raw"格式,并确保选择了"JSON"类型。接下来,可以在请求的Body中以JSON格式传递参数。比如,如果要传递一个名为"name"的参数和一个名为"age"的参数,可以按照以下格式传递:
{
"name": "John",
"age": "25"
}
这样,在后端的接收方法中使用@RequestBody修饰对应的参数,即可接收到这些参数的值。 [2<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [postman接口测试的几种传参形式](https://blog.csdn.net/weixin_41851719/article/details/81222612)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [Postman 接口传参报错解决与@RequestBody的注解作用记录](https://blog.csdn.net/m0_49692893/article/details/129442660)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文