What it actually parses
The input is rarely a curl command somebody typed. It is what the browser’s network tab put on the clipboard: a multi-line shell expression with backslash continuations, a dozen header flags, single-quoted values containing double quotes, and a body containing both. So the parser is a real POSIX shell tokeniser rather than a split on whitespace.
Single quotes are taken literally, double quotes honour the four escapes the shell honours, a backslash outside quotes escapes the next character, and a backslash-newline is a continuation that disappears. Anything less falls over on the first apostrophe inside a JSON body, which is why so many converters mangle a genuinely pasted command.
- Method inference matching curl’s own rule - an explicit -X wins, then a body implies POST, then GET
- Headers from -H, -A, -b and -e, plus the --flag=value spelling
- Bodies from -d, --data-raw, --data-binary and --data-urlencode
- Basic credentials from -u, emitted as the target language’s own auth mechanism