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\": \"\" }"

相关推荐
大汉堡玩测试1 天前
抓包工具Whistle的安装与使用
测试工具
oi..1 天前
Linux入门(2)
linux·笔记·测试工具·安全·网络安全
路飞雪吖~1 天前
【测试】接口测试---1个框架,5个模块
开发语言·python·测试工具
独断万古他化1 天前
基于 Selenium + POM 模式的聊天室系统 UI 自动化测试框架搭建与实践
selenium·测试工具·ui·自动化·测试·pom
Wild_Pointer.2 天前
高效工具实战指南:Beyond Compare文件比较工具
测试工具
Three~stone2 天前
Wireshark 4.6.4 安装教程
网络·测试工具·wireshark
Luminbox紫创测控3 天前
太阳光模拟器在汽车智能玻璃的运用
测试工具·汽车
西瓜程序猿3 天前
如何将纸质版礼薄转换为电子礼薄?可以使用记了么
测试工具·创业创新
123过去3 天前
crunch使用教程
linux·测试工具·安全
123过去3 天前
samdump2使用教程
linux·测试工具·安全