oha
oha copied to clipboard
Not able to run -H with content body
oha -z 20s -H "Authorization: Bearer $TOKEN" -T application/json -d to=+25078xxxxxx text="Hello" sender="Hello" 'https://api.pindo.io/v1/sms/'
error: Found argument 'sender=Hello' which wasn't expected, or isn't valid in this context
USAGE:
oha [FLAGS] [OPTIONS] <url>
For more information try --help
Currently, -d option takes one argument and just set HTTP body.
The command failed because it parsed to=+25078xxxxxx as body, text="Hello" as URL, and the rest as invalid arguments.
oha -z 20s -H "Authorization: Bearer $TOKEN" -T application/json -d 'to=+25078xxxxxx&text=Hello&sender=Hello' 'https://api.pindo.io/v1/sms/'
would works.