RESTFUL接口请求参数总结
GET :
1.路径参数 @PathVariable
2.表单参数 @RequestParam
POST:
1.JSON请求体参数
@RequestBody
PUT:
1.路径参数 @PathVariable
2.表单参数 @RequestParam
DELETE:
1.路径参数 @PathVariable
2.表单参数 @RequestParam
综上,最好只有POST使用JSON BODY形式,若单个参数可用路径参数,多个参数可用表单参数
GET :
1.路径参数 @PathVariable
2.表单参数 @RequestParam
POST:
1.JSON请求体参数
@RequestBody
PUT:
1.路径参数 @PathVariable
2.表单参数 @RequestParam
DELETE:
1.路径参数 @PathVariable
2.表单参数 @RequestParam
综上,最好只有POST使用JSON BODY形式,若单个参数可用路径参数,多个参数可用表单参数
相关推荐
redf1sh:让他从工作软件上问问题,举报你态度不好就甩聊天记录。一切工作要留痕