RESTFUL接口请求参数总结

GET :

1.路径参数 @PathVariable

2.表单参数 @RequestParam

POST:

1.JSON请求体参数

  @RequestBody

PUT:

1.路径参数 @PathVariable

2.表单参数 @RequestParam

DELETE:

1.路径参数 @PathVariable

2.表单参数 @RequestParam

综上,最好只有POST使用JSON BODY形式,若单个参数可用路径参数,多个参数可用表单参数

猜你喜欢

转载自blog.csdn.net/wsh596823919/article/details/81662143