get、put、delete、post几种请求在java springboot的使用方式

  • get
	@GetMapping("/apple/{account}")
	public ResponseVO queryByAccount(@PathVariable("account") String account) {


/apple/123
 @GetMapping(value = "/mid-list")
 public ResponseVO getTpmtWhiteMidList(MidQueryVO midQueryVO) {

/mid-list/
参数:
pageNO:1
pageSize:10

  • put
    需要有@RequestBody注解才能解析请求
@PutMapping
    public SemsResponseVO update(@RequestBody CplcFeatureListVo cplcFeatureListVo) {
{
    "cplc": "123123",
    "featureSetVOList": [
        {
            "id": "11",
            "count": null,
            "updtId": "222"
        },
        {
            "id": "122",
            "count": "1233",
            "updtId": "2223333"
        }
    ]
}
  • post
    同样需要@RequestBody注解
@PostMapping
    public SemsResponseVO add(@RequestBody TpmtWhiteCplcVO tpmtWhiteCplcVO) {

你可能感兴趣的:(restful,开发语言,后端,restful)