cURL to Code

Your data never leaves your browser

Convert a cURL command into JavaScript fetch, Python requests, or Node.js axios code.

Brie — Bug Reporting Tool

Found a bug while testing?

Brie captures screenshots, console logs, network data, and session replays in one click — so developers get the full context without the back-and-forth.

About cURL to Code

Paste any cURL command and instantly get the equivalent code in your preferred language. Supports the most common cURL flags: -X (HTTP method), -H (headers), -d / --data-raw (request body), -u (Basic Auth), and positional URL arguments. Output is available for JavaScript fetch, Python requests, and Node.js axios.

How to use

  1. Paste your cURL command into the input panel.
  2. Choose the target language: JavaScript fetch, Python requests, or Node.js axios.
  3. Copy the generated code snippet from the output panel.

More QA & Testing Tools

Frequently Asked Questions

FAQs about cURL to Code

Which cURL flags are supported?

The tool supports the most common flags: -X (method), -H (headers), -d and --data-raw (request body), -u (Basic Auth), and the URL as a positional argument.

Does it handle JSON bodies automatically?

Yes. When a Content-Type: application/json header is detected, the tool parses the body as JSON and formats it appropriately for the target language.

Can I convert a cURL command with multiple -H headers?

Yes. All -H flags are collected and included in the generated code as individual headers.

Is Basic Auth (-u) supported?

Yes. A -u username:password flag is converted to the appropriate Authorization header with a Base64-encoded value.

What if my cURL command uses --data-raw instead of -d?

Both -d and --data-raw are treated identically — the value is used as the request body.