@PathVariable
1:接受參數時,地址欄為:/{args1}/{args2}
2:用法:(@PathVariable(value = "args")Long id)
3:GET請求方法
@RequestParams
1:接受參數時,地址欄為:/args=?
2:用法:(@PathVariable("args")Long id)
3:GET請求方法
@RequestBody
1:接受參數時,地址欄為:/args1=?&args2=?
2:用法:(@RequestBody(value = "args")Long id)
3:POST請求方式
@GetMapping("/methodPath"):指明了get請求
@PostMapping("/methodPath"):指明了post請求
@RequestMapping(value = "/methodPath" , method = RequestMethod.POST)
@RequestMapping(value = "/methodPath" , method = RequestMethod.GET)
post請求:
export const methodsName = (request) => {
return axios.request({
url:‘請求路徑’,
data:request,
method:"post"
})
}
get請求:
exportconst methodsNamr =(args1,args2)= {
return axios.request({
url:”/abc?x1=”+ args1 + “&x2=“+args2,
method:‘get’
})
}