HyperText Transfer Protocol (HTTP)

HyperText Transfer Protocol (HTTP)

HTTP is a communication protocol. It defines a mechanism for communication between the browser and the web server.

It is also called request and response protocol because the communication between browser and server takes place in request and response pairs.

HTTP Request

HTTP request comprises of lines which contains:

  1. Request line
  2. Header Fields
  3. Message body

Key Points

  • The first line i.e. the Request line specifies the request method i.e. Get or Post.
  • The second line specifies the header which indicates the domain name of the server from where index.htm is retrieved.

HTTP Response

Like HTTP request, HTTP response also has certain structure. HTTP response contains:

  1. Status line
  2. Headers
  3. Message body