I wrote a REST Call that will return the health status on call
@RestController @RequestMapping(value = "/account") public class HealthCheckController { protected final Logger log = LoggerFactory.getLogger(this.getClass()); @RequestMapping(value = "/health", method = RequestMethod.GET, produces = { "application/json" }) @ResponseStatus(HttpStatus.OK) @ApiOperation(value = "Returns the health status of the application", notes = "Load balancer user this to confirm the health of the node") public @ResponseBody String getHealth(HttpServletRequest request, HttpServletResponse response) throws Exception { log.info("***" + RequestCorrelation.getId() + "***" + "HealthCheckController - getHealth () Called"); return "{\"health\":{\"SERVICES\":\"OK\"}}"; } }
When I open this in swagger or postman, it returns the correct answer. But when I hit this url in Chrome browser, I see
This page contains the following errors: error on line 1 at column 1: Document is empty Below is a rendering of the page up to the first error.
Why is that? and how to fix it?
source share