Code & QA Zone: Tutorials, Tools, Guides & Tips for Developers & Testers

How to Copy a Request as cURL from DevTools

When debugging or testing APIs, you often need to replicate a request outside the browser. Chrome DevTools allows you to copy any network request as a cURL command in seconds.

So today I’ll show you a quick trick to get the cURL command of an endpoint directly from your browser’s Developer Tools (DevTools).

This will save you time when testing endpoints. If you already have the endpoint available from a web app, you’ll see how convenient this is. It’s just copy, paste, and execute.

Let’s start!

1. Go to the Network tab and locate the endpoint

Open your browser DevTools (F12 or right-click → Inspect), go to the Network tab, and locate the request you want to extract the cURL from.

Step 1 - Copy curl from devtools

2. Right-click the request → Copy → Copy as cURL

Right-click on the request and select: Copy → Copy as cURL

Step 2 - Copy curl from devtools

This copies the full request, including:

  • Method (GET, POST, etc.)
  • Headers
  • Cookies
  • Authorization tokens (if present)
  • Request body (if applicable)

It will be something like this:

curl 'https://api.example.com/users' \
  -H 'Authorization: Bearer your-token' \
  -H 'Content-Type: application/json'

3. Import the cURL into Postman

Now go to Postman, click Import, and paste the cURL command.

Step 3 - Copy curl from devtools

Step 4 - Copy curl from devtools

Postman allows you to:

  • Save it into an existing collection
  • Or use it without saving

Step 5 - Copy curl from devtools

4. Done! Your request is ready to execute

You’ll notice that all important details like headers, authentication tokens, and payload are included automatically.

This makes it incredibly useful for:

  • Debugging
  • Reproducing bugs
  • Sharing requests with teammates
  • Quick API validation

Step 6 - Copy curl from devtools

Step 7 - Copy curl from devtools

Bonus: What else can you copy?

The Copy menu offers several useful options, including:

  • Copy URL
  • Copy as fetch (Node.js)
  • Copy request headers
  • Copy response
  • Copy stack trace

Depending on what your needs are, these can also save you a lot of time.

Copy curl from devtools - bonus

Thank you for reading!