工具:STS
问题:description The server refused this request because the request entity is in a format not supported by the requested resource for the requested method.
中文意思:
Status 415 服务器拒绝了这个请求因为请求实体格式的请求资源的请求的方法不支持。
原因: @RequestMapping(value = "/tbValue", method = RequestMethod.GET)
@ResponseBody
public String tbValue(@RequestBody String req) {
return "836";
}
在访问这个方法的时候,我没有加参数,所以格式不对,所以要在地址栏跟上参数,或者你就去掉req参数
在访问rest服务的时候,返回类型必须是String类型的,否者也会报错这个错误