38-Creating a Complete REST Application Flashcards
What does REST stand for?
REpresentational State Transfer
What does REST emphasize?
Scalability
What does HATEOAS stand for?
Hypermedia As The Engine of Application State
What is the REST specification in Java?
JAX-RS
Implementations of JAX-RS
- Jersey (RI)
- RESTEasy
- Restlet
- CXF
What JAX-RS implementations are supported by Spring?
- Jersey (RI)
- RESTEasy
- Restlet
- CXF
Does Spring MVC implement JAX-RS?
No
What combined request mapping annotations are supported?
- GetMapping
- PostMapping
- PutMapping
- PatchMapping
- DeleteMapping
What request methods must use @RequestMapping?
- HEAD
- OPTIONS
- TRACE
How to use @RequestMapping?
e.g. @RequestMapping(path=”hello”, method=RequestMethod.GET)
What request mappings are implemented automatically by Spring?
- HEAD
2. OPTIONS
What objects help to translate JSON to Java objects and vice versa?
Message converters
Which controller method do we need to return a ResponseEntity?
For POST as we need to return the location of the created object
e.g. return ResponseEntity.created(location).build()
What response should PUT return?
204 no content and empty body
What response should DELETE return?
204 no content and empty body