RestFul 記錄

經常使用的HTTP請求格式:java

普通的GET請求&Controller的定義:app

http://localhost:8080/controller/func?a=1&b=2spa

@RequestMapping(value = "func", method = RequestMethod.GET)
public Object query(@RequestParam("a") String a,@RequestParam("b") String b)

 

RestFul的Get請求&Controller的定義code

http://localhost:8080/controller/func/a/bclass

@RequestMapping(value = "func/{a}/{b}", method = RequestMethod.GET)
public Object query(@PathVariable String a,@PathVariable String b)

 

REST只是一種風格,不是一種標準請求

 

待續...ping

相關文章
相關標籤/搜索