Best Division

Spread Your Knowledge

  • All topics
  • About us
  • Contact us
  • Privacy policy
  • Terms of service
  • Copyright
  • Facebook
  • Twitter
  • Instagram
  • Youtube
  • LinkedIn
  • Pinterest
  • Github
  • Tumblr

© 2026 Best Division

What Is HTTP and How Does the Request Response Cycle Work?

Web DevelopmentCSS
Jayant Kumar
Jayant Kumar@jayantkumar314
PublishedNov 22, 2026
5 min read

HTTP (HyperText Transfer Protocol) is the set of rules a browser and a web server use to exchange web pages and other data. In the request response cycle, the client sends a request naming what it wants, the server processes it and sends back a response containing a status code, headers and usually a body such as HTML or JSON.

Every time you open a page, submit a form or load an image, at least one HTTP exchange happens. Understanding this cycle is the foundation for everything else about the web, from APIs to caching.

Table of Contents

  • What HTTP is and where it fits
  • The request response cycle step by step
  • Anatomy of an HTTP request
  • Anatomy of an HTTP response
  • Making your own request
  • HTTP versions and HTTPS in brief
  • Frequently Asked Questions
    • What does stateless mean in HTTP?
    • What is the difference between HTTP and HTTPS?
    • Is HTTP the same as the internet?
    • Which port does HTTP use?
  • Summary
  • Related Articles

What HTTP is and where it fits

HTTP is an application-layer protocol. It defines the format of messages, not how bits travel over the network. Underneath, the browser opens a TCP connection (or a QUIC connection for HTTP/3), and secure connections add TLS, which is what HTTPS means.

HTTP is a client-server protocol. The client, normally a browser, always starts the conversation. The server waits for requests and answers them. A server cannot send an ordinary HTTP response unless a request came first.

HTTP is also stateless: each request is independent, and the server does not remember earlier requests by default. Sites that need to remember you, for example to keep you logged in, use cookies or tokens.

The request response cycle step by step

When you type https://example.com/products into the address bar, this happens:

  1. The browser looks up the server's IP address using DNS.
  2. It opens a connection to that address, and for HTTPS completes a TLS handshake.
  3. It sends an HTTP request.
  4. The server runs its code or finds a file, then sends an HTTP response.
  5. The browser reads the response, renders the HTML, and sends more requests for the CSS, JavaScript and images it references.

A single page usually needs many request response cycles, one for each file. The Network panel in your browser's developer tools lists all of them.

Anatomy of an HTTP request

A request has a request line, headers and an optional body. This is a simple one in the HTTP/1.1 text format:

http
  • The method (GET) says what action you want.
  • The path and query string (/products?category=books) identify the resource.
  • The version (HTTP/1.1) names the protocol version.
  • Headers carry extra information such as the host name and the formats you accept.
  • The body, used by methods like POST, carries data such as a form or JSON.

HTTP/2 and HTTP/3 send the same information in a binary format rather than plain text, but the ideas (method, path, headers, body, status) are identical, and tools show them in the same way.

Anatomy of an HTTP response

The server answers with a status line, headers and a body:

http
  • The status code (200) and reason phrase (OK) report the outcome. Codes beginning with 2 mean success, 3 redirection, 4 a client error and 5 a server error.
  • Headers describe the response, such as its content type and how long it may be cached.
  • The body is the actual content: HTML, a stylesheet, an image or JSON.

Making your own request

You can watch the cycle yourself with curl. The -i flag prints the response headers along with the body, and -v also shows the request that was sent.

bash
text

You can do the same from JavaScript in a browser or in Node.js 18 and later with the Fetch API:

javascript
javascript
Loading syntax highlighting...

fetch() sends the request, and the returned Response object exposes the status, headers and body.

HTTP versions and HTTPS in brief

VersionMain idea
HTTP/1.1Text-based; one request at a time per connection, so browsers open several connections
HTTP/2Binary; many requests share one connection (multiplexing) and headers are compressed
HTTP/3Runs over QUIC instead of TCP, which reduces delay when packets are lost

Browsers and servers negotiate the best version automatically. Plain HTTP sends data readable by anyone on the path, so modern sites use HTTPS, which encrypts the traffic and verifies the server's identity with a certificate. Browsers mark HTTP-only pages as not secure.

Frequently Asked Questions

What does stateless mean in HTTP?

Each request is handled on its own, with no built-in memory of earlier ones. Cookies, sessions and tokens are added on top to remember users.

What is the difference between HTTP and HTTPS?

HTTPS is HTTP carried over a TLS encrypted connection. The messages have the same format, but they are protected from eavesdropping and tampering.

Is HTTP the same as the internet?

No. The internet is the global network. HTTP is one protocol that runs over it, alongside others such as SMTP for email.

Which port does HTTP use?

HTTP uses port 80 by default and HTTPS uses port 443. Browsers hide the default port in the address bar.

Summary

HTTP is a stateless, client-server protocol. The client sends a request with a method, path, headers and an optional body, and the server returns a response with a status code, headers and a body. One page load involves many such cycles, and HTTPS adds encryption. Related articles cover methods, status codes and headers in detail.

Related Articles

  • What Is the Difference Between Static and Dynamic Websites?
  • What Are HTTP Methods GET, POST, PUT, PATCH and DELETE?
  • Learn Web Development: Complete Roadmap for Beginners
Share