Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

responseentity spring boot

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));
 
PREVIOUS NEXT
Tagged: #responseentity #spring #boot
ADD COMMENT
Topic
Name
3+9 =