1. 程式人生 > >SpringMvc中,RequestMethod可以同時支援POST GET訪問麼?(二)

SpringMvc中,RequestMethod可以同時支援POST GET訪問麼?(二)

一、POST訪問

@RequestMapping(value="/subscribe/getSubscribeList/{customerCode}/{sid}/{userId}",method = RequestMethod.POST)

二、GET訪問

@RequestMapping(value="/subscribe/getAllSubscribeItemList/{customerCode}/{sid}/{userId}",method = RequestMethod.GET)

三、同時支援POST訪問和GET訪問

         @RequestMapping(value="/subscribe/getSubscribeList/{customerCode}/{sid}/{userId}")

post和get的區別:GET把引數包含在URL中,POST通過request body傳遞引數。

http://www.techweb.com.cn/network/system/2016-10-11/2407736.shtml