http post提交数组
来源:互联网 发布:算法统宗以碗知僧 编辑:程序博客网 时间:2024/05/18 16:39
方式一:@RequestParam方式
服务提供方用@RequestParam注解接收参数,参数类型为long数组:
@ApiOperation(value = "***", tags = "***", notes = "***", response = ***)@RequestMapping(value = "delivery", method = RequestMethod.POST)public Object convert( @RequestParam(value = "id", required = true) @ApiParam(value = "id数组", required = true) long[] id) { return userService.convert(id);}
服务调用方拼接多个id参数请求服务:
http://**/delivery?id=1&id=2
方式二:@RequestBody方式
服务提供方用@RequestBody注解接收参数,参数类型为long数组:
@ApiOperation(value = "***", tags = "***", notes = "***", response = ***)@RequestMapping(value = "/delivery", method = RequestMethod.POST)public Object delivery(@RequestBody long[] id) { return userService.delivery(id);}
服务调用方把数组放在body中,已application/json方式提交,postman示例如下:
阅读全文
0 0
- http post提交数组
- http post提交数据
- http post提交数据
- $http.post提交示例
- post工具提交数组
- 使用file_get_contents提交http post
- 使用file_get_contents提交http post
- HTTP 模拟POST方式提交
- Http Post、Get提交工具
- angularjs $http 提交post问题
- 使用file_get_contents提交http post
- android http post提交数据
- file_get_contents提交http post get
- Http post提交和get提交
- vc http post传参提交
- http post 协议 向服务器提交图片
- PHP技术现实HTTP提交POST事件
- java模拟http get和post 提交
- 搭建redis集群
- 华为VRP命令行基础
- mysql导入大批量数据出现MySQL server has gone away的解决方法
- android TextView不用ScrollViewe也可以滚动的方法
- php手册阅读记录
- http post提交数组
- ipconfig /release和ipconfig /renew这两个命令的含义
- 开发一个基于React Native的简易demo--前记
- 第一天-开通了CSDN的博客
- java基础—常用的GC策略,什么时候会触发YGC,什么时候触发FGC?
- MHA简单配置与应用
- Android jpg图像解码崩溃
- vue router报错
- Spark几种运行模式