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
- REST Architecture
- RESTful API Design
- REST Controller
- @RestController
- JSON Request
- JSON Response
- Jackson
- ObjectMapper
- JSON Serialization
- JSON Deserialization
- HttpMessageConverter
- MappingJackson2HttpMessageConverter
- HTTP Status Codes
- API Versioning
- REST API Best Practices
- Mini Project: REST Details: PUT vs PATCH, Pagination, ETag and Allowed Methods