@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