Skip to content

How to copy a Firefox network request as a cURL command

Firefox's Network Monitor can turn any request it records into a ready-to-run cURL command.

OUTPUT FORMATSHTMLJSONMarkdown

The copied command carries the request URL, method, headers, cookies and body, so it can be replayed from a terminal without rebuilding it by hand. This guide walks through capturing the right request, copying it, running it, and working out why a copied command sometimes behaves differently from the browser.

What Copy as cURL actually captures

When you copy a request from the Network Monitor, the resulting command reproduces that single exchange. It includes the request URL, the HTTP method, the headers Firefox sent, any cookies attached to the request, and the request body where one exists. Because headers and cookies travel with the command, authentication that the browser was already carrying is included too.

What it does not include is the surrounding page workflow. If the request depended on JavaScript that ran earlier, on browser state, on an anti-bot check, or on another request completing first, the copied command will not recreate those conditions. Keep that boundary in mind: you are copying one request, not the page.

Capture the request in four steps

  1. Open the page that issues the request, then open the Network Monitor. Use Ctrl + Shift + E on Windows or Linux, or Cmd + Option + E on macOS.
  2. Trigger the request again. Repeat whatever caused it — clicking a button, submitting a form, or simply reloading the page.
  3. Locate the correct entry in the request list, right-click it, and choose Copy Value, then Copy as cURL.
  4. Paste the command into your terminal and press Enter. It runs the request as Firefox sent it, headers, cookies and authentication included.

Before you run anything, read the pasted command. It contains live cookies and authorization headers, so treat it like a password: avoid sharing it in tickets, chat or public pastes, and re-copy rather than reuse it once the session has expired.

Decide which failure you are looking at

Most problems with a copied command fall into one of three buckets, and each has a different fix.

  • Nothing appears in the Network Monitor. The panel was opened after the request already happened. Reload the page or repeat the triggering action with the panel open.
  • The command returns 401 or 403. The request was captured correctly, but a cookie, session token, authorization header or CSRF token inside it has expired. Sign in again and copy the request a second time.
  • The request succeeds in Firefox but fails in cURL. The command itself is fine; the request depends on something outside it — JavaScript-generated values, browser state, anti-bot checks, or an earlier request that must run first.

Separating these three cases stops you from re-copying a request that was never the problem, and from chasing credentials when the real gap is the browser workflow.

Worked example: a form submission that stops working

Suppose you submit a form and copy the POST request as cURL. The command runs and returns the expected response. An hour later the same command returns 403.

Nothing about the command changed, so the request capture is not the issue — the session token embedded in its headers has expired. Signing in again in Firefox and repeating the copy produces a fresh command that works. If instead the fresh command still fails while the browser succeeds, the cause is upstream of the request: check whether the page generates a value in JavaScript, sets a header through a script, or sends a preparatory request before the one you copied.

From cURL to another language

Once a command runs correctly in the terminal, you can paste it into a curl converter to translate it into the language or HTTP client you want to use. Do the translation after the command is confirmed working, so any failure you hit later is a translation problem rather than a capture problem.

What a copied cURL command carries and what it leaves behind
ElementIncluded in the copied commandWhat to check if it is missing or stale
Request URLYesConfirm you right-clicked the intended entry in the request list
HTTP methodYesVerify the entry is the POST/PUT you meant, not a preflight or duplicate
HeadersYesLook for authorization and CSRF headers; re-copy after signing in
CookiesYesExpired session cookies cause 401/403 — sign in and copy again
Request bodyYes, where one existsCheck the body was captured for form and JSON submissions
JavaScript-generated valuesNoRegenerate in the browser and re-copy, or reproduce the script logic
Browser state and prior requestsNoReplay the earlier request first or use a browser-capable client
Anti-bot checksNoExpect failures even with a valid copy

Reflects how Firefox's Copy as cURL behaves in the Network Monitor; menu labels and shortcuts can change between Firefox versions, so verify in your installed build.

Frequently asked questions

Why is my Firefox Network Monitor empty?

The panel was probably opened after the request had already been sent. Reload the page or repeat the action that triggers the request while the Network Monitor is open.

Why does the copied command return 401 or 403?

A cookie, session token, authorization header or CSRF token in the command has likely expired. Sign in again in Firefox and copy the request once more.

Why does the request work in Firefox but fail in cURL?

The request may rely on JavaScript-generated values, browser state, anti-bot checks, or another request that runs first. A copied command reproduces one request, not the page's full browser workflow.

Does Copy as cURL include my cookies and login headers?

Yes. The copied command includes the headers and cookies Firefox sent, including authentication. Treat the pasted command as sensitive and avoid sharing it publicly.

Can I convert the copied command to Python or another language?

Yes. Once the command works in your terminal, paste it into a curl converter to translate it into the language or HTTP client you need.