HTTP requests and responses are the lifeblood of the web, but looking at raw packets can feel like trying to read a book by examining individual ink molecules. Wireshark, however, lets you zoom out and see the conversations clearly, revealing not just what was sent, but the intent behind it and the outcome.

Let’s watch a simple GET request and its response unfold. Imagine you’re browsing a static HTML page from a web server on your local network.

192.168.1.100 (your machine) -> 192.168.1.200 (web server)
GET /index.html HTTP/1.1
Host: 192.168.1.200
User-Agent: Wireshark/3.4.0
Accept: */*

---

192.168.1.200 (web server) -> 192.168.1.100 (your machine)
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1234
Date: Mon, 01 Jan 2024 12:00:00 GMT

<!DOCTYPE html>
<html>
<head>
    <title>My Page</title>
</head>
<body>
    <h1>Hello, Wireshark!</h1>
</body>
</html>

In Wireshark, if you filter for http, you’ll see these packets. The first one, the GET request, is sent from your machine to the server. Wireshark decodes the TCP segments and presents the HTTP request in a human-readable format. You can see the method (GET), the requested resource (/index.html), and crucial headers like Host (telling the server which website to serve if it hosts multiple) and User-Agent (identifying your browser or tool).

The second packet is the server’s response. Wireshark shows the HTTP status line (HTTP/1.1 200 OK), indicating success. Then come the response headers, like Content-Type (telling your browser how to interpret the data, here text/html) and Content-Length (the size of the body in bytes). Finally, you see the actual HTML content in the packet’s data payload.

The real power comes when you right-click on an HTTP request packet and select "Follow" -> "HTTP Stream". Wireshark will reassemble the TCP segments and present a single, continuous stream of the HTTP conversation between your client and the server. This is where you can see the entire request and response, including any subsequent requests for images, CSS, or JavaScript files, all laid out chronologically. It’s like having a transcript of the web page loading.

This stream view is invaluable for debugging. If you see a 404 Not Found status, you can immediately check the requested URL in the stream to see if it’s a typo or a missing file. If a page is slow to load, you can examine the Content-Length and timing of individual requests within the stream to pinpoint bottlenecks. You can also see how cookies are being exchanged, what authentication headers are being sent, and how redirects (3xx status codes) are handled.

Let’s consider a POST request, where data is sent to the server.

192.168.1.100 -> 192.168.1.200
POST /submit_form HTTP/1.1
Host: 192.168.1.200
Content-Type: application/x-www-form-urlencoded
Content-Length: 25

name=Alice&age=30

---

192.168.1.200 -> 192.168.1.100
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 30

{"status": "success", "id": 123}

In the POST example, the Content-Type header tells the server the format of the data being sent (here, URL-encoded form data), and Content-Length specifies its size. Following the HTTP stream will show you both the request body (name=Alice&age=30) and the server’s response, which might be a JSON object indicating the result of the form submission. This allows you to verify that the data you intended to send actually arrived at the server correctly.

When analyzing these streams, pay close attention to the Content-Type header. It dictates how the payload should be interpreted, whether it’s HTML, JSON, XML, or plain text. Wireshark’s "Follow HTTP Stream" feature can sometimes guess the content type, but understanding it yourself is key to interpreting the data accurately. For instance, if you’re expecting JSON but see a Content-Type: text/html, it might indicate an error page was returned instead of your data.

The ability to filter by http.request.method == "POST" or http.response.code == 404 allows you to isolate specific types of traffic, making it easier to sift through large capture files. You can also examine individual HTTP headers by expanding the "Hypertext Transfer Protocol" section in Wireshark’s packet details pane. For example, looking at http.cookie will show you any cookies being sent by the client or set by the server.

The most surprising thing about Wireshark’s HTTP analysis is how readily it can reconstruct complex, multi-packet HTTP conversations into a single, coherent dialogue, even when dealing with encrypted traffic if you have the keys. It doesn’t just show you packets; it shows you the story those packets tell about client-server interactions.

You might notice that some HTTP traffic appears as TCP packets without the HTTP layer decoded. This often happens when the traffic is encrypted using HTTPS.

Want structured learning?

Take the full Wireshark course →