oha icon indicating copy to clipboard operation
oha copied to clipboard

Headers not working

Open Ch4s3r opened this issue 3 years ago • 1 comments

This command should not result in this error, as I also tried without the header and the URL is correctly parsed, only when adding the header the command does not work anymore.

> oha -H "foo: bar" http://localhost:8080/
error: The following required arguments were not provided:
    <url>

USAGE:
    oha [FLAGS] [OPTIONS] <url>

And the headers -H resides in the OPTIONS section, so this should be fine. -H "foo: bar" was taken from the example in the help.

oha version 0.4.7

Ch4s3r avatar Jul 02 '22 11:07 Ch4s3r

This is because of the old clap's behavior. in newer oha with version >= 0.5.0 (which has deps update for clap), you can run

> oha -H "foo: bar" http://localhost:8080/

without problem.

You can run like

> oha -H "foo: bar" --  http://localhost:8080/

in older oha

Related issue: https://github.com/hatoo/oha/issues/131

hatoo avatar Jul 02 '22 14:07 hatoo