spring mvc 同时支持get和post请求

来源:互联网 发布:键盘按键记录软件 编辑:程序博客网 时间:2024/04/30 07:00

@RequestMapping(value = "/api/component/imgconf/getimgconf",method = {RequestMethod.POST, RequestMethod.GET})@ResponseBodypublic Object getImgConf(HttpServletRequest request,@RequestParam(value = "downImageConfigRequest", required = true) String json){//此处省略很多代码}

这样终端发起请求的时候可以用post也可以用get。get的可以这样请求/api/component/imgconf/getimgconf.do?json="参数值"

0 0
原创粉丝点击