@RequestMapping(value = "/api/component/imgconf/getimgconf",method = {RequestMethod.POST, RequestMethod.GET})
@ResponseBody
public Object getImgConf(HttpServletRequest request,
@RequestParam(value = "downImageConfigRequest", required = true) String json){
//此处省略很多代码
}这样终端发起请求的时候可以用post也可以用get。get的可以这样请求/api/component/imgconf/getimgconf.do?json="参数值"
本文介绍了一个RESTful API接口的设计案例,该接口支持GET和POST两种请求方式获取图片配置信息。通过传递JSON参数,客户端能够灵活地从服务器端获取所需的图片配置。
410

被折叠的 条评论
为什么被折叠?



