1. 程式人生 > >spring boot 2.* 參數接收

spring boot 2.* 參數接收

傳遞 boot system pri str oot 1.0 ring .post

測試環境:spring boot 2.1.0
/*
//數組和參數同時傳遞需要借助實體類實現
//接收json
@RequestMapping(value = "test3",method = RequestMethod.POST)
public String test3(@RequestBody String obj){
System.out.println(obj);
return "1";
}
//接收數組
@RequestMapping(value = "test2",method = RequestMethod.POST)
public String test2(String[] obj){
System.out.println(obj);
return "1";
}
//接收指定參數
@RequestMapping(value = "test1",method = RequestMethod.POST)
public String test1(String id){
System.out.println(id);
return "1";
}*/

spring boot 2.* 參數接收