post请求

@Controller
@RequestMapping("api")
public class ApiController {
    @RequestMapping("query")
    @ResponseBody
    public String query(@RequestBody final Request request) {
  }
}

  

RequestBody要求发送post请求,模拟请求发下:

 

curl --data '{"name":"test","age":25}' -v -X POST -H 'Content-Type:application/json' http://localhost:8087/api/query

  

posted @ 2016-03-08 11:59  waterystone  阅读(254)  评论(0编辑  收藏  举报