Mapping Requests

Mapping HTTP requests to controller methods: verbs and paths, reading request data, and choosing the response.

  • 6 cards
  • 4 questions
  • About 6 min
  • Intermediate to Advanced
Share

Web layer of a REST API: how an HTTP request reaches a Java method, and how the method's return value becomes the response. Spring Boot has a specific annotation for each part of that translation, and choosing the right one decides the status code and headers a client sees. It covers the mapping annotations for each HTTP verb, reading data from the path, the query string and the body, ResponseEntity, and the difference between @RestController and @Controller. It leaves out HTML templates and content negotiation.

Contents

6 cardsnot started