Closed ethanmsl closed 5 months ago
Brackets have a special meaning in zsh so you will have to either precede your command with noglob
or surround each request item with quotes
$ xh pie.dev/post \
'platform[name]=HTTPie' \
"platform[about][mission]='Make APIs simple and intuitive'" \
'platform[about][homepage]=httpie.io' \
'platform[about][homepage]=httpie.io' \
'platform[about][stars]:=54000' \
'platform[apps][]=Terminal' \
'platform[apps][]=Desktop' \
'platform[apps][]=Web' \
'platform[apps][]=Mobile'
Also, see https://stackoverflow.com/a/71307929
The xh docs specifically mention accepting json path like syntax and refer the user to the httpie syntax docs. Specifically:
However xh does not appear to accept this syntax. Replacing
httpie
withxh
orxhs
just leads to a series ofzsh: command not found:..
as the command doesn't await input. Placing the command on a single ine or prefacing with--json
does not remedy the situation.I similarly tried with command that I know work as cURL commands and was unable to make xh recognize any nested json commands. If there is someway to convince xh to accept the syntax then some example may assist.