Beginner Topic 15 of 50 Computer Networks
HTTP
Application protocol for requests and responses on the web.
How it works
The Hypertext Transfer Protocol is the request-response protocol of the web. A client sends a method such as GET or POST, a path, headers and an optional body; the server returns a status code, headers and a body. It is stateless, so cookies and tokens carry sessions. Status classes are 2xx success, 3xx redirects, 4xx client errors and 5xx server errors. HTTP/1.1 uses persistent connections, HTTP/2 multiplexes streams and HTTP/3 runs over QUIC.
Step-by-step walkthrough
- The browser sends GET /index.html.
- The server finds the resource.
- It replies 200 OK with headers and the HTML body.
- The browser renders it and requests images and scripts.
- HTTP is stateless, so cookies carry session identity.
Where it is used
Websites, REST and GraphQL APIs, mobile app backends, webhooks and microservices all use HTTP. Caching headers, content negotiation and range requests make it efficient.
Common pitfall
Plain HTTP is unencrypted, so use HTTPS. Misusing methods, for example changing state with GET, breaks caches and safety. Ignoring status codes, timeouts and retries causes fragile clients. Large headers and cookies add overhead on every request. Idempotency matters when retrying.
Where it fits in the course
HTTP is topic 15 of 50 in Computer Networks, rated Beginner. It follows DHCP. The next topic is Ports and Sockets.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Computer Networks quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Computer Networks quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is HTTP?
Where do people use HTTP?
What is the most common mistake with HTTP?
What should I learn before this topic?
How can I practice it?
Is HTTP hard to learn?
How long does it take to learn HTTP?
Which topics are related to HTTP?
What should I study after HTTP?
Related topics
- DHCP (Computer Networks)
- Ports and Sockets (Computer Networks)
- DNS (Computer Networks)
- Packet Switching (Computer Networks)