Search⌘ K
AI Features

HTTP: Response Messages

Explore the components of HTTP response messages, including status lines, headers, and the entity body. Understand common status codes like 200, 404, and 500, and how servers and browsers decide which headers to include. This lesson helps you grasp how responses work in HTTP communication.

Introduction

Let’s start with a typical example of an HTTP response message:

Shell
HTTP/1.1 200 OK
Connection: close
Date: Tue, 18 Aug 2015 15: 44 : 04 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Tue, 18 Aug 2015 15:11:03 GMT
Content-Length: 6821
Content-Type: text/html
[The object that was requested]

It has 3 parts: an initial status line, some header lines and an entity body.

Note: HTTP response messages don’t have the URL or the method fields. Those are strictly for request messages.

Status Line

  • HTTP response status lines start with the HTTP version.

Status Code

  • The status code comes next which tells the client if the request succeeded or failed.
...