About HTTPie Command Generator
Fill in the request and copy an http command for HTTPie, the friendly command-line client. Headers become Name:value items, a flat JSON object becomes key=value and key:=value items, and form fields are sent with --form.
Everything is quoted for a POSIX shell such as bash or zsh, so spaces, quotes and dollar signs reach HTTPie untouched. When a body cannot be written as items without changing its meaning, it is passed whole with --raw instead, and a note says why.
How it works
- The URL is checked and written the way it will be sent. Header lines become Name:value items; an empty value is written as Name; so that HTTPie sends it empty rather than removing it.
- In a flat JSON object, string values become key=value and numbers, booleans, null, arrays and nested objects become key:=value with the JSON written out.
- Keys with spaces, brackets or separators, values beginning with = or @, arrays at the top level and integers beyond JavaScript’s exact range all switch the body to --raw, which sends it whole with every value exactly as typed.
- Each argument is single-quoted only when the shell would otherwise change it.
Questions
Does this work in PowerShell or the Windows command prompt?
The quoting is for POSIX shells: bash, zsh and sh. Fish, PowerShell and cmd.exe treat quotes or backslashes differently, so a value with spaces or quotes may need rewriting there. Windows Subsystem for Linux and Git Bash work as written.
Which HTTPie version do I need?
Item syntax works in every recent version. The --raw option, used for text bodies and for JSON that items cannot express, arrived in HTTPie 3.0.
Why is the method always written out?
HTTPie guesses GET without a body and POST with one. Writing the method keeps the command correct for a DELETE with a body or a POST without one, and makes it easier to read.
Is anything sent from this page?
No. The tool only writes the command; you run it yourself. The form is not saved in the address bar, so a token in a header stays out of your history.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.