liveBook · Manning

HTTP response

As explained in Spring Start Here, Second Edition

An HTTP response is a message returned by an HTTP server containing a status and optional headers and content.

An HTTP response carries data from a backend to a client in reply to a request. It includes a status and may carry headers and a body. section 10.3

The main parts of a response are:

  • Response headers: short pieces of information. section 10.3
  • Response body: the larger amount of data sent back. section 10.3
  • Response status: a short indication of the request’s result. section 10.3

For a REST endpoint, Spring MVC returns the controller action’s result directly in the HTTP response, without rendering a view. section 10.1

Figure 10.2 When implementing REST endpoints, the Spring MVC flow changes. The app no longer needs a view resolver because the client needs the data returned by the controller’s action directly. Once the controller’s action is completed, the dispatcher servlet returns the HTTP response without rendering any view.

Follow how Spring MVC returns the controller action’s result as a response without a view resolver. section 10.1

How Spring Start Here, Second Edition covers it

How deep it goes
Defines headers, body, and status, while directing readers elsewhere for fuller HTTP details.
What it assumes
Review basic HTTP details before examining response parts; the treatment directs readers to refresh that background.
What you can do after
Understand what information an HTTP response carries and how Spring MVC returns a REST controller action’s result.
How it connects
Connects REST endpoints, controller actions, Spring MVC, response headers, response body, and response status.

Also explained in

Compare how 7 books explain HTTP response →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring Start Here, Second Edition. The section links point to the parts of the book it draws on.