How It Works Under the Hood
A deterministic POSIX shell lexer tokenizes single-quoted strings, double-quoted strings with escapes, ANSI-C `$\x27...$\x27` quoting, and line-continuation backslashes (`\`). Parsed flags (`--request`, `--header`, `--data*`, `--user`, `--json`) map to a typed HTTP request AST, which emits idiomatic snippets for Fetch, Axios, Python `requests`, and Go `net/http`.
Step-by-Step Instructions
Paste a `curl ...` command copied from Chrome DevTools, Postman, or API documentation.
Check the Parsed Summary chips (HTTP Method, URL, Headers count, Basic Auth, Body type).
Select your output runtime (`JavaScript Fetch`, `Axios`, `Python requests`, or `Go net/http`).
Inspect optional redacted-header view or copy the generated code straight into your repository.
Key Features & Performance
- Runs completely offline — protects live `Authorization: Bearer` tokens, cookies, and API keys
- Handles multiline `\` continuations, `-H`, `-X`, `-d`, `--data-raw`, `--data-binary`, `--json`, and `-u user:pass`
- Outputs clean, dependency-minimal snippets for 4 targets (Fetch, Axios, Python, Go)
- Automatically extracts query parameters cleanly and formats JSON request bodies
- Zero external API calls
Methodology, Formulas & Technical Standards
Shell tokenization follows POSIX sh quoting boundaries without executing shell evaluation (`eval`). When `-d`/`--data*` is supplied without `-X`, the parser defaults HTTP method to `POST` matching `curl` behavior. When `--json` is passed, `Content-Type: application/json` and `Accept: application/json` headers are auto-attached.
Common Real-World Use Cases
- Converting Chrome Network "Copy as cURL" requests (containing live session cookies) safely into Node/Browser `fetch()`
- Translating Stripe, OpenAI, or webhook cURL docs into typed Go `http.NewRequest` or Python `requests` boilerplate
- Inspecting headers, URL parameters, and raw JSON payloads inside complex multi-line shell commands
- Onboarding backend scripts quickly without exposing staging endpoints online
Worked Examples & Edge Cases
cURL with Bearer Token & JSON Body
curl -X POST https://api.example.com/v1/items -H "Authorization: Bearer tok_123" -d '{"name":"widget"}' fetch("https://api.example.com/v1/items", { method: "POST", headers: { "Authorization": "Bearer tok_123", "Content-Type": "application/x-www-form-urlencoded" }, body: JSON.stringify(...) }) Explicit `-H "Content-Type: application/json"` or `--json` signals JSON serialization in Axios/Python.
Basic Auth (-u)
curl -u admin:secret https://status.internal/health
Python: requests.get("https://status.internal/health", auth=("admin", "secret")) Translates `-u` cleanly to native `auth` parameters in Python/Axios/Go or `Authorization: Basic` in Fetch.
Limitations, Scope & Accuracy Notes
- • Multipart file uploads (`-F file=@/path`) emit commented placeholder hints because browsers cannot read arbitrary OS paths from cURL text.
- • PowerShell backtick (`^` or `` ` ``) Windows `curl.exe` escaping differs slightly from bash `Copy as cURL (bash)`.
Local Browser Processing & Privacy
Traditional web converters upload your documents, snippets, or media files to remote servers. cURL to Fetch, Axios, Python & Go Converter runs inside your browser tab:
Your input text and files are processed locally without uploading payloads to a processing server.
Microdeck does not log or store the files or inputs you paste into tool workspaces (normal static hosting/CDN requests still load page assets).
Working outputs stay in your browser tab and are released when you reset the tool or close the tab.
Frequently Asked Questions
Why does copying cURL into normal online converters risk leaking credentials?
Chrome DevTools "Copy as cURL" embeds your active `Cookie` and `Authorization` headers. Pasting those into server-backed tools sends live session tokens over the wire. Microdeck parses locally in RAM.
Which curl flavor should I copy from Chrome DevTools?
Choose "Copy as cURL (bash)" on macOS/Linux/Windows for full POSIX quoting compatibility.
What happens if I omit -X POST when passing -d?
Just like real `curl`, our converter automatically infers `POST` whenever body flags (`-d`, `--data-raw`, `--json`) appear without an explicit `-X` method.
Does it execute the HTTP request?
No. It strictly parses text and generates code without making any network request.
Explore Related Micro-Tools
HAR Trace Inspector & Secret Redactor
Analyze slow HTTP .har waterfalls and scrub Cookies, Bearer tokens & API keys before sharing bug reports
Base64, URL & Hex Multi-Format Encoder/Decoder
Auto-detecting multi-codec converter for Base64, URL percent-encoding, Hex & HTML
JSON Formatter, Validator & Diff
Format, validate, compare diffs & auto-repair malformed JSON locally in your browser