我在controller层传的参数是List时报No primary or single unique constructor found for interface java.util.List
于是加了@RequestParam,结果报Required request parameter ‘pointlist’ for method parameter type List is not present,是因为@RequestParam不支持post请求
注解 | 支持的类型 | 支持的请求类型 | 支持的Content-Type | 请求示例 |
---|---|---|---|---|
@PathVariable | url | GET | 所有 | /test/{id} |
@RequestParam | url | GET | 所有 | /test?id=1 |
@RequestBody | Body | POST/PUT/DELETE/PATCH | json | {“id”:1} |