cURL to C# / Java / Axios / Guzzle / Faraday
Converts a curl command into C# HttpClient, Java 11 HttpClient, JavaScript axios, PHP Guzzle or Ruby Faraday code. It reads headers, bodies, form fields, basic auth and common flags.
Use the tool
Why this tool exists
API documentation almost always shows curl. Your project is in C#, Java, PHP or Ruby, or uses axios, and you have to translate headers, bodies and authentication by hand. That is where small mistakes creep in: a missing content type, a wrongly escaped JSON body, a form sent as JSON. Paste the curl command here, pick the target and get code that does the same request. The tool understands -X, -H, -d, --data-urlencode, --json, -F, -u, -k and -L. Other languages have their own tools on this site: Python, fetch and Node are covered by the main cURL to Code tool, and Go and Rust have separate converters. Your command, which may include tokens, is parsed in your browser.
How to use it
- Paste the curl command, including line continuations, into the input box.
- Choose the target language or library from the list.
- Copy the generated code and replace any secrets with environment variables before committing.
Frequently asked questions
Which curl options are understood?
Method (-X), headers (-H), data (-d and --data-urlencode), --json, multipart form fields (-F), basic auth (-u), insecure (-k) and follow redirects (-L). Unsupported flags are ignored, so check the output against your intent.
How is multipart handled?
Multipart bodies from -F are supported for C#, Guzzle and Faraday. Java and axios output turns them into a URL-encoded body instead, which is not the same on the wire, so adjust if the server needs multipart.
Does it send the request?
No. It only parses the text and writes code. Nothing is executed, and no request is made from the page.
Where are Python, fetch or Go conversions?
Python, fetch, Node and plain PHP are in the main cURL to Code tool. Go and Rust have their own converters on this site.