← All topics
Quiz: REST APIs: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. Which status code should a successful POST that creates a resource return?
- Q2. Which URL design follows REST conventions for deleting course 7?
- Q3. What does @RequestBody do?
- Q4. Which HTTP method is NOT idempotent?
- Q5. Why return DTOs instead of JPA entities from controllers?
- Q6. What status should a successful DELETE with no response body return?
- Q7. What does @PathVariable Long id read in @GetMapping("/{id}")?
- Q8. Where should a filter like "courses costing at most 3000" go in a REST URL?
- Q9. What does "stateless" mean for a REST API?
- Q10. What does ResponseEntity.created(uri).body(course) send?