Back to the 2023 paper

Module II: Browser & Apache Web Server Architecture; Common Protocols

20237m

What is HTTP? Explain the steps that are involved for each request from a client to the server.

Worked SolutionAI Assisted

HTTP and Client-to-Server Request Steps

HTTP (HyperText Transfer Protocol) is an application-layer protocol used for communication between clients and web servers. It follows a request-response model.

Steps

  1. Enter/request URL: The browser determines the target resource.
  2. DNS resolution: The domain name is resolved to an IP address when necessary.
  3. Connection: The client establishes a connection to the server (typically TCP; HTTPS also establishes TLS security).
  4. HTTP request: The browser sends a request containing a method such as GET or POST, URL/path, headers and possibly a body.
  5. Server processing: The web server/application processes the request, possibly accessing files, code or databases.
  6. HTTP response: The server returns a status code, headers and usually a response body.
  7. Browser processing: The browser interprets the response and renders the page; it may make additional requests for CSS, JavaScript, images, etc.
  8. Connection reuse/close: The connection may be reused or closed according to the protocol and headers.

Example

Browser → HTTP GET /index.html → Web Server
Browser ← HTTP 200 + HTML ← Web Server

Common status codes: 200 OK, 404 Not Found, 500 Internal Server Error.

Similar questions