Turning a Network Tab Copy Into Code You Can Run
By toolbelt maintainers ·
Copy as cURL gives you a working request. You need working code. The conversion is mechanical except for the four places it is not.
What is this tool?
A curl command is a complete HTTP request in one line. Converting it to your language means preserving method, headers, body and authentication exactly.
How it works
I tokenise the command the way a shell would — respecting quotes and line continuations — then read the flags into a request description. From that I generate code for each language. Anything I do not understand is reported rather than silently dropped. That matters: a converter that quietly loses your Authorization header produces code that 401s and teaches you nothing.
Example
curl 'https://api.example.com/v1/users' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
--data-raw '{"name":"Ada"}'
becomes Python:
import requests
headers = {
'Authorization': 'Bearer TOKEN',
'Content-Type': 'application/json',
}
payload = {"name": "Ada"}
response = requests.request('POST', 'https://api.example.com/v1/users',
headers=headers, json=payload)When to use it
Reproducing a request in your language without retyping headers. Turning a browser session into a scraper or a test. Documenting an API call in a bug report.
Optimization Tips
Check for multipart forms. curl -F is a different body format and is reported as unsupported rather than mangled, so add it by hand. Also remember that a copied command often contains live cookies — strip them before you paste the code into a repository.
Frequently Asked Questions
Which languages are supported?
Why was a flag ignored?
Are my headers sent anywhere?
Can it read a command from Firefox?
Related tools
- JSONPath QueryQuery JSON with JSONPath expressions, including wildcards, recursive descent and simple filters. See exactly which nodes matched before you write the code.
- HTTP Header AnalyzerPaste a response header set and see which security headers are missing or weak. Checks CSP, HSTS, frame protection, referrer policy and header disclosure.
- JSON ValidatorValidate JSON syntax with detailed error messages. Catch trailing commas, missing brackets, and syntax errors instantly before sending payloads to your API.
- JSON FormatterBeautify, validate, minify, and view JSON. Format messy API responses into readable code or compress it to save bandwidth, running safely in your browser.