get请求的Restful Web服务方法
我正在尝试为get请求编写一个web服务方法,其返回类型为ResponseEntity。但当我试着从邮递员那个里运行这个时,它给出的响应体是不可接受的。下面是我的方法的结果和代码get请求的Restful Web服务方法,rest,web-services,postman,get-request,getresponse,Rest,Web Services,Postman,Get Request,Getresponse,我正在尝试为get请求编写一个web服务方法,其返回类型为ResponseEntity。但当我试着从邮递员那个里运行这个时,它给出的响应体是不可接受的。下面是我的方法的结果和代码 <html> <head> <title>Error</title> </head> <body>Not Acceptable</body> </html> 提前谢谢 @GetMa
<html>
<head>
<title>Error</title>
</head>
<body>Not Acceptable</body>
</html>
提前谢谢
@GetMapping("/v1/showMyDetails.html")
public ResponseEntity tryingGetWithAnnotation(){
ResponseEntity responseEntity = null;
JSONObject jsonObj = new JSONObject();
jsonObj.put("name","nikhil");
responseEntity = new ResponseEntity(jsonObj,HttpStatus.OK);
return responseEntity;
}