Rest Api 是前後分離的一次實踐,是開發的一套標準或者說是規範。
首先我們構建一個Spring boot項目
在選擇依賴的時候添加Spring web
設置端口號爲8081
新增Controller 添加@RestController 以及@RequestMapping 註解
瀏覽器請求接口
也可以用Postman直接傳值類引入 使用@RequestBody註解
Rest Api 是前後分離的一次實踐,是開發的一套標準或者說是規範。
首先我們構建一個Spring boot項目
在選擇依賴的時候添加Spring web
設置端口號爲8081
新增Controller 添加@RestController 以及@RequestMapping 註解
瀏覽器請求接口
也可以用Postman直接傳值類引入 使用@RequestBody註解