Convert curl to HTTPie
Convert curl commands to HTTPie syntax. curl2code runs entirely in your browser via WebAssembly — your data stays private. For raw HTTP, try our curl to HTTP converter. For Wget, see curl to Wget. Below are ready-to-use HTTPie examples.
How to copy curl from your browser
- 1
Open DevTools
Press F12 or Ctrl+Shift+I to open your browser developer tools.
- 2
Go to the Network tab
Click the Network tab and perform the action that triggers the HTTP request.
- 3
Copy as cURL
Right-click the request → Copy → Copy as cURL. Then paste it above.
Frequently Asked Questions
What is HTTPie?
HTTPie is a user-friendly command-line HTTP client designed for API testing and debugging. It features colorized output, JSON support by default, expressive syntax, and persistent sessions. Install with pip install httpie or brew install httpie. curl2code converts curl commands to HTTPie's more readable syntax.
HTTPie vs curl vs wget — which CLI tool to use?
HTTPie is the most readable — ideal for API testing and interactive use. curl is the most feature-rich and universal — available on every system. Wget specializes in downloading files and mirroring sites. Use HTTPie for daily API work, curl for scripts and automation. See also curl to Wget.
How does HTTPie handle authentication?
HTTPie has built-in auth: http -a user:pass GET url for Basic auth. For Bearer: http GET url 'Authorization:Bearer token'. Auth plugins support OAuth, JWT, and more. HTTPie's auth is simpler than curl's -u and -H flags — one of its key usability advantages.
How to send form data with HTTPie?
Use -f flag for form data: http -f POST url field=value file@path.pdf. HTTPie auto-detects content type. For JSON (the default): http POST url name=John age:=30. The := operator sends raw JSON values. This is much more intuitive than curl's -F and -d flags.
How to handle errors with HTTPie?
HTTPie shows colorized response status and body by default. Use --check-status to exit with error codes on HTTP errors (exit code 4 for 4xx, 5 for 5xx). Use --print=hHbB to control output: request/response headers and body. Pipe to jq for JSON error parsing.
How does HTTPie handle JSON?
JSON is HTTPie's default — it automatically sets Content-Type: application/json and pretty-prints JSON responses with syntax highlighting. Use = for string values, := for raw JSON, :=@ for JSON from file. This is HTTPie's biggest advantage over curl's manual -H and -d approach.
How to use HTTPie for API debugging?
Use --verbose (or -v) to show the full request and response including headers. Use --offline to preview the request without sending. Use --session=name for persistent cookies and headers across calls. HTTPie's colorized output makes debugging significantly more readable than curl's -v.
What HTTPie plugins are available?
Popular plugins: httpie-oauth for OAuth, httpie-jwt-auth for JWT, httpie-aws-auth for AWS Signature V4, httpie-edgegrid for Akamai. Install with pip install httpie-plugin-name. HTTPie also supports ~/.httpie/config.json for default headers and settings.
How to represent a POST request with JSON body in HTTPie?
Use curl's -X POST -d '{"key":"value"}' -H "Content-Type: application/json" and curl2code will convert it to HTTPie format: http POST url key=value. The JSON body and Content-Type header are preserved in the output. curl2code handles both inline JSON and @file.json references.
How to include Bearer token authorization in HTTPie?
When you convert curl -H "Authorization: Bearer YOUR_TOKEN" URL with curl2code, the Bearer token is preserved in the HTTPie output: http url Authorization:'Bearer YOUR_TOKEN'. Both -H "Authorization: Bearer ..." and OAuth token flags are detected automatically.
How is Content-Type represented in HTTPie format?
When converting curl -H "Content-Type: application/json" URL, curl2code outputs the Content-Type in HTTPie as: http --json url. Common types include application/json, application/x-www-form-urlencoded, and multipart/form-data. curl2code preserves the exact Content-Type from the original curl command.