What is the use of ResponseEntity in Spring boot?
ResponseEntity represents an HTTP response,
including headers, body, and status. While @ResponseBody puts the return value
into the body of the response, ResponseEntity also allows us to add headers and status code.
return ResponseEntity.status(code).build();
new ResponseEntity<>(HttpStatus.valueOf(status));