REQUESTS & RESPONSESEDITORIAL DRAFT

What is HTTP?

Useful first: IP addresses · optional, not a requirement

Choose your depth

Stay with the essentials, or look closer.

Simple explanation
2 min read · estimate

YOUR GOALRecognize HTTP as the rules for exchanging web requests and responses.

Your browser asks. A server answers.

Ordering from a menu

Imagine asking for a sandwich at a cafe. You make a request, and the cafe responds. On the web, your browser asks a server for something, such as a page or a picture. The server sends a response.

HTTP stands for Hypertext Transfer Protocol. A protocol is a set of communication rules. HTTP gives browsers and servers a shared way to ask for things and explain what happened.

[1]
TRY A REQUESTOne request. One response.
YOUR BROWSERGET /guideA request names the resource.
THE SERVER200 OKThe response contains the page.

The page exists, so this example responds with 200 OK. Try the missing picture to compare.

A teaching illustration. No request is sent to another website.

One page can involve several requests

A page can need separate requests for its text, pictures, and other parts. The browser puts the results together. The cafe comparison has limits: HTTP exchanges structured messages, not spoken orders.

[1]
THE IDEA TO KEEP

HTTP is how a browser and a server exchange requests and responses.

ONE THING TO WATCH OUT FOR

Loading one page always means receiving everything in one response.

A page can need several resources, fetched through separate requests.

A QUICK CHECK, NOT A TEST
Your browser asks a server for a picture. What is that message?
Show the explanation

A request. The browser sends the request. The server answers with a response.

Progress is saved only in this browser.

NEXT IN THE LEARNING PATHCaching
Was this explanation clear?
Report a mistake by email
Basic explanation
2 min read · estimate

YOUR GOALIdentify the method, target, headers, body, and response status.

Read the request. Then read the result.

What travels in a message?

A request identifies a target, such as /topics/dns/, and a method describing the requested operation. Headers carry extra information. Some messages also have a body: the content being sent.

A response includes a status code, headers, and sometimes a body. For a successful page request, the body may contain HTML. A Content-Type header tells the browser the content's format. Not every response includes a body.

[2]

GET and POST do different jobs

GET asks to retrieve a representation of a resource: data that describes it, such as an article's HTML. POST sends content for the target to process, for example a submitted comment. A method describes the requested operation; it does not promise that the operation will succeed.

[3]

The status describes this request

  • 200 OK: the request succeeded.
  • 301 Moved Permanently: the resource has a new permanent address.
  • 404 Not Found: the server did not find the requested resource.
  • 500 Internal Server Error: an unexpected server condition prevented completion.

A page can load while a separate image request gets a 404. Check which request produced the status before deciding what is broken.

[4]
THE IDEA TO KEEP

The request says what to do; the response status says how that request turned out.

ONE THING TO WATCH OUT FOR

A 404 means my device has no internet connection.

A 404 is an HTTP response about a requested resource. It is different from failing to receive any response.

A QUICK CHECK, NOT A TEST
A page's HTML request returns 200, but its picture request returns 404. What does that tell you?
Show the explanation

The page request succeeded, but the picture was not found. Each response describes its own request. One successful request does not guarantee that all the page's resources loaded.

Progress is saved only in this browser.

NEXT IN THE LEARNING PATHCaching
Was this explanation clear?
Report a mistake by email
Advanced explanation
2 min read · estimate

YOUR GOALDistinguish safe from idempotent methods, and semantics from the protocol version.

Method semantics matter when requests repeat.

Safe describes the requested effect

A safe method does not request a state change. GET is safe by definition, even though a server can record an access log. An endpoint that deletes an article on GET violates those semantics.

[5]

Idempotent does not mean identical responses

An idempotent method has the same intended effect when an identical request is repeated as when it runs once. PUT and DELETE are idempotent; POST is not guaranteed to be.

Repeating a POST after losing its response could repeat the action. A client needs evidence that a retry is appropriate, not just an unanswered request.

[5]

Versions change how messages travel

HTTP/2 uses binary frames and interleaves multiple streams on one TCP connection. Each stream carries its own exchange; the application still uses methods and status codes.

HTTP/3 carries HTTP over QUIC, which provides streams at the transport layer. A newer version changes the transport and message framing, not the meaning of GET or 404. It does not make a non-idempotent operation safe to repeat.

[6] [7]
THE IDEA TO KEEP

Before retrying, consider the operation's semantics; the HTTP version does not decide them.

ONE THING TO WATCH OUT FOR

Idempotent requests must return the same status and content every time.

Idempotence concerns the intended server effect, not identical responses.

A QUICK CHECK, NOT A TEST
A DELETE succeeds. Repeating it returns 404. Does that alone break idempotence?
Show the explanation

No. The resource can remain absent. Idempotence concerns repeated effects, not identical responses. DELETE changes state, so it is not safe.

Progress is saved only in this browser.

NEXT IN THE LEARNING PATHCaching
Was this explanation clear?
Report a mistake by email
GO STRAIGHT TO THE SOURCE

Keep asking. Check the details.

Source-linked, AI-assisted draft. Human editorial review is still pending; this page is not presented as expert-reviewed.

  1. MDN — Overview of HTTP
  2. MDN — HTTP messages
  3. MDN — HTTP request methods
  4. MDN — HTTP response status codes
  5. RFC 9110 — HTTP semantics: safe and idempotent methods
  6. RFC 9113 — HTTP/2
  7. RFC 9114 — HTTP/3
How explanations are prepared