Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to run -H with content body #146

Open
kenessajr opened this issue Jul 6, 2021 · 1 comment
Open

Not able to run -H with content body #146

kenessajr opened this issue Jul 6, 2021 · 1 comment

Comments

@kenessajr
Copy link

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

@hatoo
Copy link
Owner

hatoo commented Jul 7, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants