skip to content

In the Chrome DevTools Network panel, how do you find one failing API call among hundreds of requests and see what it sent and received?

level: juniorimportance: must knowfreq 58%

answer

  1. open it before you act
  2. type buttons, then filter terms
  3. survive the redirect
  4. the Status column has more than numbers
  5. Headers, Payload, Response tabs

basics

~20 s

Open DevTools before triggering the call, click the Fetch/XHR type filter, narrow with terms such as status-code:500 or method:POST, tick Keep log if the page navigates, then click the row and read Headers, Payload and Response.

solid answer

~40 s

The panel only records while DevTools is open, so I open it first and then reproduce the problem. I click the `Fetch/XHR` type button and type filter terms such as `status-code:500`, `method:POST` or `domain:api.example.com`; space-separated terms must all match, and a `-` prefix negates one. If the page redirects, I tick **Keep log**, which older guides call Preserve log, so the request survives navigation. Failed rows show in red, and the Status column holds a code, `(failed)`, or a reason such as `(blocked:devtools)`. Clicking the row opens **Headers** for URL, method and headers, **Payload** for what was sent, and **Response** or **Preview** for what came back. That tells me whether the client sent the wrong thing or the server answered wrongly.

go deeper

for a junior

Recall the routine: open the panel first, use Fetch/XHR, a filter term or two, Keep log for redirects, then Headers, Payload and Response on the row.

for a middle

Explain that filter terms combine as AND, that a leading minus negates, and that status-code matches exactly, so you can narrow quickly instead of scrolling through a long list.

for a senior

Show the triage habit: use the Status value and the Payload to assign the problem to client, server or connection before touching any code, and say what evidence you would hand over.

for a principal

Connect it to how a team reports bugs: asking for the failing request's URL, status, payload and response in every ticket removes a round of questions and shortens every investigation.

## Why this is the first stop The **Network panel** in Chrome DevTools lists the requests a page makes while DevTools is open: documents, scripts, images and the API calls the page sends with `fetch` or `XMLHttpRequest`. A failing API call is the most common reason to open it. The job has three parts: capture the call, narrow the list down to it, and read what actually crossed the wire. ## Capture the request first The list starts when DevTools opens. A request that happened before that moment is not in it, which is why the first move is always to open the tools and then repeat the action. 1. Open DevTools and select the **Network** panel. 2. Check that recording is on, because the record button at the top of the panel can be switched off. 3. If the action navigates or reloads the page, tick **Keep log**. Without it the list is cleared on navigation, and a form POST that redirects vanishes just as you look for it. Older guides call this checkbox Preserve log; the current label is Keep log. 4. Perform the action that fails. ## Narrow the list A busy page produces hundreds of rows, so filter in two steps. First use the **type buttons**: `Fetch/XHR` drops scripts, images and fonts in one click. Then use the **filter box**. | Term | What it shows | |---|---| | `status-code:500` | Requests whose status is exactly 500 | | `method:POST` | Requests sent with that HTTP method | | `domain:api.example.com` | Requests to that domain; a `*` wildcard is allowed | | `larger-than:1M` | Responses larger than the given size | | `checkout` | A plain word matches the host and path of the URL | Three rules make the box useful: - **Terms separated by spaces must all match**, so `status-code:500 method:POST` means POST requests that returned 500. - **A leading `-` negates a term**, so `-status-code:200` hides the successful calls. - **`status-code` compares the whole value.** `status-code:5` matches nothing, and there is no `5xx` form. To see every server error, sort by the **Status** column or scan for red rows. ## Read the Status column The Status column does not always hold a number, and the difference matters. - **A number** means an HTTP response came back, so the server answered. Failed rows, which include 4xx and 5xx responses, are drawn in red. - **`(failed)`** means no usable response arrived, so there is usually no HTTP status to reason about. Look at connectivity or the request's address first. - **`(canceled)`** means the request was dropped before it finished, often because the page aborted it or navigated away. - **`(pending)`** means the browser is still waiting. - **`(blocked:devtools)`** or another `(blocked:...)` value means something stopped the request, and the word after the colon names what. `devtools` means your own blocking rule did it. - **`CORS error`** means the browser refused to hand the response to the page. The rules behind that error are a separate subject; the Status column is only where you first see it. ## Read the request itself Clicking a row opens a detail pane with tabs. Each answers a different question. | Tab | Question it answers | |---|---| | **Headers** | Which URL and method, which status, which request and response headers? | | **Payload** | Which query parameters and request body did the page send? | | **Preview** | What does the response look like, parsed and formatted? | | **Response** | What exact body came back? | | **Cookies** | Which cookies went out and came back? | | **Initiator** | Which code or request caused this one? | | **Timing** | Where did the time go? | ## Decide whose problem it is Reading those tabs in order usually settles who needs to act. - **The URL or Payload is wrong.** The client built a bad request, so go to the frontend code. The Initiator tab points at it. - **The request looks right and the status is 5xx.** The server failed; take the Response body to whoever owns the API. - **The status is 401 and the credentials are missing.** Check the Authorization header on the Headers tab and the Cookies tab before blaming the server. - **The status is 200 and the UI is still wrong.** Read the Response. If the body is right, the bug is in how the page handles it, not in the network. A last habit worth having: clear the list with the panel's clear button just before you reproduce the failure. Fewer rows means fewer filters, and the failing call is then near the top of a short list rather than buried in a page load.

  • Why does `status-code:5` in the Network filter box show nothing when the page clearly has 500 errors?
    The filter compares the status code as a whole string, so `5` only matches a request whose status is literally 5. There is no range or `5xx` form. To see all server errors, sort by the Status column, scan for red rows, or use exact codes such as `status-code:500` and `status-code:503` one at a time.
  • A failed request shows `(failed)` and `status-code:500` does not find it. Why?
    `(failed)` usually means no HTTP response arrived, so the request has no status code for the filter to match. Find it with the `Fetch/XHR` button, its URL, or the red rows. The cause sits below HTTP: the address, connectivity or the connection itself, rather than the server's application code.
  • What is the difference between the Preview and Response tabs for a JSON API call?
    **Response** shows the body as it arrived, which is what you quote when reporting a bug. **Preview** renders the same body for reading, so JSON becomes a collapsible tree. If they seem to disagree, trust Response for the exact bytes as text, and use Preview for navigating a large document.

  • Opens DevTools after the failure and expects the earlier request to be in the list.
  • Says the log survives a redirect without ticking Keep log.
  • Types status-code:5xx and believes the Network filter accepts status ranges.
  • Treats (failed) as an HTTP 500 and goes straight to the server logs.
  • Believes space-separated Network filter terms mean any one of them may match.
  • Reads only the status and never opens Payload to see what the client sent.