Skip to main content

ResponseEntity

Learn ResponseEntity (REST API with Spring MVC, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes ResponseEntity represents the whole HTTP response: status code, headers and body, returned from a controller method. Use it when the status or headers depend on the result, for example 201 with a Location header or 404 when nothing is found. Generic : ResponseEntity<T> where T is the body type, and the body is converted by an HttpMessageConverter .

More lessons in REST API with Spring MVC