Skip to content

What Is HTTP? Requests, Responses, and How to Inspect Them

HTTP is the everyday language of the web: a browser or other client asks, a server answers. Understanding its few moving parts — method, target, headers, status, and body — makes it much easier to read a network trace, choose the right tool, and spot whether a problem is on the request side or the response side.

The basic exchange

HTTP, short for HyperText Transfer Protocol, has been the core way web clients and web servers communicate since the early web. Before it, the internet relied on separate protocols for different kinds of information. HTTP largely replaced those for web content, while other protocols such as SMTP retained their own roles.

The model is simple: one side asks, the other side answers. The asking side is the client — often a browser, but also an API consumer, a phone app, or a connected device. The answering side is the server. The client opens the connection and sends a request containing everything the server needs to act. The server handles that request and returns a response. That one-way initiation matters when debugging: if no request was sent, there will be no response to inspect.

Methods: what the client is asking to do

Every request begins with a method, written as an uppercase verb, that tells the server what kind of action is intended. A small standard set covers most work, even though custom methods are possible in theory.

GET is the workhorse for retrieval. It should not change the resource and repeated identical calls should return the same result — that repeatability is what idempotent means here, even if real implementations do not always honour it.

POST is the usual choice for submitting data to the server, for example an upload or a form submission, and it typically carries a body.

Other standard methods fill narrower roles. HEAD, for instance, asks for the headers a GET would return while leaving the resource data out of the reply. PATCH, PUT and others handle partial or full updates. When you need the full current list, the MDN methods reference is the place to check rather than memorising every verb.

Anatomy of a request

A minimal HTTP 1.1 request, shown in protected module code0001, has three parts: a request line, one header, and a blank line that closes the header section.

Read the request line in three pieces. First comes the method, GET in the example. Next is the request target, usually a path such as / for a site root. Last is the HTTP version, 1.1 here.

Headers follow. Real requests often carry ten to twenty of them. User-Agent describes the client software, Accept lists the resource types the client can handle, and Authorization carries credentials when authentication is needed. Cookies and many other fields travel as headers too.

The blank line after the headers is a delimiter, not filler. It marks the end of the headers. If there is no body, the request ends there. If there is a body, it starts immediately after that blank line.

A body is optional and depends on the method. GET should not carry one; POST usually does. When a body is present it may be sent as-is or encoded, with Transfer-Encoding describing how it was encoded.

Decision checklist for reading a request: confirm the method matches the intent, confirm the target points at the intended resource, check Host and other headers for the right site and client details, then look past the blank line only if a body is expected.

Anatomy of a response

A response mirrors the request layout, which is why the two are easy to confuse at a glance. Protected module code0002 shows the shape: a first line, several headers, a blank delimiter, then the payload.

The first line is the status line. It carries the HTTP version, a three-digit status code, and a short text description of that code. The code is the key signal for whether the server handled the request successfully.

Status codes are grouped by their first digit. Codes from 200 to 299 signal success. Codes from 100 to 199 carry informational hints. Codes from 300 to 399 indicate redirections. Codes from 400 to 499 point to client-side problems such as missing authentication or a malformed request. Codes from 500 to 599 point to server-side errors.

Response headers then add context about the reply. Server names the software in use, and Content-Type gives the MIME type of what is being received. After the blank delimiter comes the response body, which usually holds the requested page, image, or other resource. Its encoding is described by Transfer-Encoding, just as with a request body.

A practical distinction: most requests have no body, while most responses do, because responses exist to deliver content. If a response has no body where you expected one, check the method first — a HEAD reply, for example, is designed to omit it.

Versions, from 0.9 to 3.0

HTTP 1.1 is text-based, which makes it the clearest version for learning the concepts above. The wider history helps explain why you still meet it everywhere.

Version 0.9, from 1991, supported only GET and was meant simply to fetch a document. Version 1.0, in 1996, added a broader method set including POST and PUT. Version 1.1, in 1997, introduced features that underpin the modern web, notably virtual hosting, and remained dominant for many years. Version 2.0, in 2015, moved to a binary protocol with frames, improving concurrency and pipelining, and mainstream implementations effectively require encryption. Version 3.0, in 2022, kept similar semantics to 2.0 but replaced TCP with UDP for better network performance and dropped unencrypted connections.

Older versions are rarely used now, yet 1.1 persists because of legacy systems and because its plain-text structure is easier to read and debug by hand.

Trying a request by hand

You can try an exchange yourself with common command-line tools. curl and Postman are popular options, and PowerShell includes Invoke-WebRequest. For a bare-metal approach, Telnet or Netcat let you type the request as plain text, which works because HTTP 1.x is text-based.

Protected module code0003 opens a connection to a host on port 80, the default for HTTP. Protected module code0004 is the request you type once connected, and protected module code0005 shows the kind of response you can expect back. Do not forget the blank delimiter line after the headers.

For an encrypted connection, use OpenSSL instead of Telnet. Protected module code0006 connects on port 443 with the server name supplied, which is the pattern for HTTPS.

HTTPS: HTTP inside a TLS tunnel

HTTP on its own is always plaintext. Security comes from wrapping it in an SSL or TLS layer, and that wrapped form is HTTPS. The request and response you read about above stay the same; the tunnel underneath them is what encrypts the exchange. HTTP was among the early protocols to adopt SSL, and HTTPS is now the norm, though the underlying protocol alone still provides no encryption.

One server, many sites: virtual hosting

Before HTTP 1.1, a client could not tell a server which site it wanted when several sites shared one address. The Host header solved that by letting the client name the intended site regardless of how many the server hosts. That naming ability is the heart of virtual hosting. TLS has a related mechanism in SNI, with ECH as a more secure successor.

Inspecting exchanges in the browser

Your browser already logs every exchange. Press F12, open the developer tools, and choose the Network tab to see all requests made by the current tab. Select an entry to inspect the request headers that were sent and to review the response, including its headers, a payload preview, and timing information.

Use the Network tab when the question is about HTTP itself — which method was used, what headers went out, what status came back. Other devtools panels are better suited to HTML, JavaScript, or CSS problems. In Firefox, you can also right-click a Network entry and choose Resend to build and send a custom request from the tab.

Summary

HTTP is a client-initiated, request-response protocol. Requests are built from a method, a target, headers, an optional body, and a blank delimiter. Responses answer with a status line, headers, the same delimiter, and usually a body. Status codes tell you at a glance whether the outcome was success, information, redirection, a client error, or a server error. Versions evolved from simple text retrieval to binary, encrypted, and UDP-based designs, while 1.1 remains common. Encryption is never part of HTTP itself — it arrives through TLS as HTTPS. And when you need to see any of this in practice, the browser Network tab is the fastest place to start.

HTTP status code groups
Status rangeMeaning
100-199Informational hints
200-299Success
300-399Redirections
400-499Client-side errors
500-599Server-side errors

Ranges as described in the source material; individual codes vary within each range.

HTTP version timeline
VersionYearKey change
0.91991GET only, for fetching a document
1.01996Broader method set including POST and PUT
1.11997Virtual hosting and other modern-web foundations
2.02015Binary protocol with frames; improved concurrency
3.02022UDP instead of TCP; encryption by default

Dates and changes as presented in the source material.

Frequently asked questions

What does HTTP stand for?

HTTP stands for HyperText Transfer Protocol. It is the request-response protocol a client uses to ask a server for a resource or send data to it, and the server uses to return a response.

Who starts an HTTP connection?

Only the client opens the connection. The server waits for a request and then replies; it does not initiate a direct connection to the client.

What is the difference between GET and POST?

GET is for fetching information without changing the resource and should be idempotent. POST is typically used to submit data, such as uploading a file, and usually carries a request body.

What are the parts of a request and a response?

A request starts with a request line containing method, target and version, followed by headers, a blank delimiter line, and an optional body. A response starts with a status line containing version, three-digit status code and description, followed by headers, the same delimiter, and usually a body.

Is HTTP encrypted by default?

HTTP itself is plaintext. Encryption comes from an added SSL/TLS layer underneath it, which is what makes the exchange HTTPS.

How can one server host several sites?

The Host header lets a client name the site it wants when several sites share one server address. That naming is the basis of virtual hosting in HTTP 1.1 and later.