Browser DevTools Copy Options: Copy as cURL and Beyond
In Chrome or Edge, open DevTools, go to the Network panel, right-click a request and open Copy. Copy as cURL turns the request into a curl command (on Windows you get a cmd and a bash version), Copy as PowerShell turns it into Invoke-WebRequest, Copy as fetch into JavaScript, and Copy response copies the response body. The "Copy as" options reproduce the request's headers, which usually include your cookies or an Authorization token, so treat what you copied as a credential.
Every item in the Network panel's Copy menu
Microsoft Edge's DevTools are built on the same Chromium code as Chrome's, so the menu is the same in both.
| Menu item | What lands on the clipboard |
|---|---|
| Copy URL | The request URL |
| Copy as cURL (cmd) | A curl command quoted for Command Prompt (Windows only) |
| Copy as cURL (bash) | A curl command quoted for bash: Git Bash, WSL, Linux, macOS. On macOS and Linux this is the only cURL option, labelled Copy as cURL |
| Copy as PowerShell | An Invoke-WebRequest -UseBasicParsing command, with a web session object that carries the cookies and user agent |
| Copy as fetch | A JavaScript fetch() call to run in a browser console |
| Copy as fetch (Node.js) | A fetch() call for Node.js, with the Cookie header written in |
| Copy as preload element | A <link rel="preload"> tag for the resource |
| Copy request headers / Copy response headers | The raw header text |
| Copy response | The response body (once the request has finished) |
| Copy stack trace | The JavaScript call stack that started the request, when there is one |
Below those, Copy all URLs, Copy all as cURL, Copy all as PowerShell and Copy all as fetch do the same for every request in the log. When a filter is active they become Copy all listed as … and cover only the visible requests. Copy all as HAR (sanitized) copies the whole log as HAR without Cookie, Set-Cookie and Authorization headers; Copy all as HAR (with sensitive data) appears only after you turn on Allow to generate HAR with sensitive data under Settings > Preferences > Network.
Which one to use
| You want to | Use |
|---|---|
| Replay the request in Command Prompt | Copy as cURL (cmd) |
| Replay it in Git Bash or WSL | Copy as cURL (bash) |
| Replay it in PowerShell | Copy as PowerShell |
| Replay it in the browser console, with the page's cookies | Copy as fetch |
| Turn it into a Node.js script | Copy as fetch (Node.js) |
| Save or inspect the response body | Copy response |
| Send a whole session to someone debugging it | Export or copy HAR (sanitized) |
Copy as fetch doesn't paste your cookies into the code. When the original request sent cookies or an Authorization header, the generated call uses credentials: "include", so the browser attaches the cookies it already has. That's why it works in the console of a logged-in tab and fails elsewhere.
Don't paste the cmd version into PowerShell
The cmd and bash versions quote and escape characters differently, and neither is written for PowerShell. In Windows PowerShell 5.1 there's a second trap: curl is an alias for Invoke-WebRequest, so a pasted curl command runs the wrong program. Use Copy as PowerShell for PowerShell, or Copy as cURL (cmd) in a Command Prompt window. Why pasting into terminals strips formatting covers other surprises when pasting commands.
Remove credentials before you share a copied request
A copied request is often exactly what a teammate or a bug report needs, and it usually carries enough to sign in as you:
- cURL puts cookies in a
-bargument and other headers in-Harguments, includingauthorization. - PowerShell adds each cookie to a
$sessionobject before the request. - fetch (Node.js) writes the Cookie header into the headers object.
Before you paste one anywhere shared, delete the cookie and authorization lines, or capture the request again while signed in to a test account. For a whole session, use the sanitized HAR. If a live cookie or token already went out, revoke it: sign out to end the session, or rotate the key, as described in what to do after copying an API key. Stack traces, tokens and the clipboard covers redacting logs the same way.
Getting a large response out
Copy response puts the entire body on the clipboard, which is fine for pasting into an editor. For anything big, paste it into a file and share the file instead of the text; how to share large JSON payloads walks through saving, formatting and redacting it. To save the whole log, use the Export HAR (sanitized) button in the Network panel toolbar.
Copy options outside the Network panel
Elements panel
Right-click a node in the DOM tree and open Copy:
- Copy element and Copy outerHTML copy the node's HTML.
- Copy selector copies a CSS selector that matches the node.
- Copy JS path copies a
document.querySelector(...)expression for it. - Copy styles copies the node's CSS declarations.
- Copy XPath and Copy full XPath copy a short and a full XPath expression, useful in test automation.
Console
The Console's copy() utility copies a string representation of whatever you pass it. copy($0) copies the element currently selected in the Elements panel. The PowerShell clipboard cheat sheet covers the equivalent on the Windows side.
Firefox
Firefox's Network Monitor has a similar Copy submenu: Copy URL, Copy as cURL, Copy as Fetch, Copy Request Headers, Copy Response Headers, Copy Response and Copy All As HAR, plus Save All As HAR on the context menu.
FAQ
What's the difference between Copy as cURL (cmd) and (bash)?
Only quoting. The cmd version escapes characters the way Command Prompt expects; the bash version uses single quotes and backslash line continuations for Unix-style shells such as Git Bash and WSL.
Does Copy as cURL include cookies?
Yes, if the request sent any. They appear in a -b argument. Remove it before sharing the command.
Why doesn't a copied fetch call work outside the browser?
Browser fetch can't set a Cookie header itself; the generated call relies on the browser's own cookies via credentials: "include". Use Copy as fetch (Node.js) for code that runs in Node.
Related reading
- How to Share Large JSON Payloads Without Pasting Them
- Copied an API Key or .env File? What to Do Next
- How to Redact Tokens From Stack Traces Before Sharing
- PowerShell Clipboard Cheat Sheet: Get-Clipboard and Set-Clipboard
Sources
- Network features reference (Chrome for Developers) — the Copy submenu, sanitized HAR and the setting for HAR with sensitive data.
- NetworkLogView.ts (Chrome DevTools frontend source, GitHub) — Windows-only cmd and bash cURL items,
-bfor cookies, the PowerShell web session, andcredentials: "include"in Copy as fetch. - DOMTreeContextMenu.ts (Chrome DevTools frontend source, GitHub) — the Elements panel Copy items.
- Console Utilities API reference (Chrome for Developers) —
copy(object)andcopy($0). - Inspect network activity (Microsoft Edge DevTools) — Edge's Network tool, based on the Chrome documentation.
- Network request list (Firefox Source Docs) — Firefox Copy and HAR options.
Deepender Yadav created Edge Drop and builds and tests it, from the edge-hover shelf to each release. A B.Tech Computer Science Engineering student, Deepender writes the Edge Drop guides, comparisons and developer posts, and checks product details against the app's source code.
GitHub · LinkedInCopy. Stack. Drop.
Transform your clipboard into an interactive edge shelf. Stack, pin, and drag assets into any app with zero friction.
Download for Windows Get from Microsoft Store
How to Install Guide · First 10 Minutes Guide · Drag & Drop Guide · Edge Drop vs Win+V · Support
Free · Lightweight · Privacy First