小工具知识网

当前位置: 首页 > 行业知识 > springboot后端接收前端传来的数组

行业知识

springboot后端接收前端传来的数组

2026-11-15 15:17:48 来源:互联网转载

1.get请求代码

@GetMapping("/batch/get")public String getArr(@RequestParam(name = "ids[]",required = true) List ids){    for (Integer id : ids) {        System.out.println(id);    }    return "发送成功";}

2.post请求代码

@PostMapping("/batch/post")public String postArr(@RequestBody List lists){    for (Integer list : lists) {        System.out.println("post请求结果遍历:"+list);    }    return "post请求发送成功";}

上一篇:俄剧网站大揭秘,热门剧集全收录,探秘无极限!

下一篇:塔式服务器,揭秘其核心优势与独特魅力