postman中请求参数和后端注解的关系

复制代码
一、@RequestParam

注解@RequestParam修饰的变量,在postman中是以Params的形式传递,如下图,name,password,force分别被注解@RequestParam修饰。

URL的显示如下:http://192.168.1.107:8001/api/v29+/auth?name=admin&password=123456&force=1

请求例子:

curl -X GET "http://host:port/api/v29+/auth?

name=admin&password=123456&force=1" -H "accept: application/json"

二、@RequestBody

注解@RequestBody修饰的变量,在postman中是以Body的形式传递

URL的显示如下:http://192.168.1.107:8001/api/v29+/ws/forwarder

请求例子:

curl -X PUT "http://host:port/api/v29+/ws/forwarder" -H "accept:

application/json" -H "Content-Type: application/json" -d "{ \"company\":

\"BL\", \"actioncode\": \"c2ls_get_server_terminals_status\", \"token\":

\"\", \"data\": {}, \"return\": 0, \"return_message\": \"\" }"

相关推荐
se-tester3 天前
JMeter、Postman 和 SoapUI 在做接口测试上的优势和缺点
测试工具·jmeter·接口测试·postman·soapui
xixi09243 天前
selenium IDE——command
selenium·测试工具
xixi09243 天前
selenium IDE安装使用教程
ide·selenium·测试工具
Wpa.wk4 天前
har文件转为接口自动化测试用例
运维·测试工具·自动化·测试用例·接口自动化
Wpa.wk4 天前
ubuntu22桌面版安装
经验分享·测试工具
脑花儿4 天前
Dify平台聊天助手 API调用案例
api·postman·dify
007张三丰4 天前
软件测试专栏(6/20):Selenium从0到1实战指南:元素定位、等待机制与框架封装
selenium·测试工具
测试老哥4 天前
如何使用Postman做接口测试?
自动化测试·软件测试·python·测试工具·测试用例·接口测试·postman
安全不再安全4 天前
某驱动任意读漏洞分析 - 可用于游戏内存数据读取
c语言·测试工具·安全·游戏·网络安全