Response Syntax

After a Web server receives an HTTP request, it will take whatever actions are necessary to provide the requested resource. This might include executing a CGI script or performing server-side logic such as PHP or ColdFusion to generate the resource. The Web server will then respond to the client with an HTTP response. This response is organized similarly to an HTTP request.

An HTTP response is broken into the following three logical pieces:

  • Status line

  • HTTP headers

  • Content

An example status line is as follows:

HTTP/1.1 200 OK 

The status line contains three elements:

  • The version of HTTP being used, in the format HTTP/x.x

  • The status code

  • A short description of the status code

Because the status code and its short description are ...

Get HTTP Developer’s Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.