What each part of the command does
Fill in the form and the command updates as you type. Nothing is sent from this page, because the tool only writes text for you to run yourself. A POST with a JSON body looks like this:
curl -X POST 'https://api.example.com/items' \
-H 'Content-Type: application/json' \
--data-raw '{"name":"Ann"}'
- -X sets the HTTP method. A plain GET needs no flag.
- -H adds one header. Repeat it for each header you need.
- --head asks for headers only, and is the correct way to send a HEAD request, because -X HEAD leaves curl waiting for a body that never arrives.
Four kinds of request body
JSON and Raw use --data-raw, which sends your text exactly. The older -d flag treats a leading @ as an instruction to read a file, so a body beginning with @ would go wrong.
Form Data uses -F, which produces multipart/form-data, the encoding browsers use for file uploads. URL Encoded uses --data-urlencode, which percent-encodes each value for you. For both, write name=value pairs on separate lines or join them with &.
Why everything is in single quotes
Inside double quotes a Unix shell still expands $VARIABLES and backticks, so a password containing a dollar sign would silently change. Single quotes switch all of that off. The only character that needs care is the single quote itself, which is written by closing the string, adding an escaped quote and reopening it:
O'Brien becomes 'O'\''Brien'
The URL is quoted for a related reason. An unquoted & tells the shell to run the command in the background and cut the URL off at that point.
Running it on Windows
The generated command is written for bash, zsh and Git Bash. The Windows command prompt does not treat single quotes as quotes and continues lines with ^ in place of a backslash. In Windows PowerShell 5, the word curl is an alias for Invoke-WebRequest, so type curl.exe to reach the real program. Git Bash and WSL run the output unchanged.
Sending a header with no value
Passing -H with a name and an empty value tells curl to remove that header. To send it empty on purpose, curl expects a semicolon after the name, as in -H 'X-Request-ID;'. If you leave the value box blank, this generator writes it that way.