赞
踩
@RequestMapping(value = "/balance", method = RequestMethod.POST)
public Result<?> balance(List<RequestDTO> requestDTOS, String type){
System.out.println(type);
System.out.println(requestDTOS.toString());
return null;
}
ps: 有些朋友可能在参数前加上注解,@RequestBody,@RequestParam
1. list作为post请求的body,数组类型
2. string 放在url上,—> ?type=2
<script> let post_data = {requestDTOS: [{},{}]} let url = 'http://demo/bank/balance?type=2'; try { $.ajax({ type: 'POST', url: url, async: false, // false: 同步请求, true: 异步请求 data: post_data, traditional: true, dataType: 'json', success: function (message) { } }) } catch (e) { console.error(e) } </script>
有帮到你的点个赞
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。