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

autocannon unable to send multiple headers to express apps #465

Open
paulsmithkc opened this issue Oct 4, 2022 · 4 comments
Open

autocannon unable to send multiple headers to express apps #465

paulsmithkc opened this issue Oct 4, 2022 · 4 comments

Comments

@paulsmithkc
Copy link

paulsmithkc commented Oct 4, 2022

I'm trying to use autocannon to do some fairly simple load testing, but autocannon is not reliably delivering all necessary headers.

Example script

npx autocannon -c 100 -p 10 -d 5 \
--renderStatusCodes --method POST \
--headers 'custom-header=Value' 'Content-Type=application/json' \
--body '{"key1":"value1", "key2":"value2"}' \
http://localhost:3022/path

Only the first header is being reliably delivered. The content-type header is coming through as undefined for most of the requests.

@GeekBeardLinks
Copy link

GeekBeardLinks commented Nov 3, 2022

You can use de --headers or --H parameter multiple times if you need to send multiple headers.

npx autocannon -c 100 -p 10 -d 5 \
--renderStatusCodes --method POST \
--headers 'custom-header=Value' --headers 'Content-Type=application/json' \
--body '{"key1":"value1", "key2":"value2"}' \
http://localhost:3022/path

@paulsmithkc
Copy link
Author

@GeekBeardLinks Tried that too and it doesn't work.

@paulsmithkc
Copy link
Author

Bump

@mcollina
Copy link
Owner

At this point in time I do not have a timeline in which I will be able to look into this. If you would like to send a PR to update the docs or send a fix, it would be awesome.

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

3 participants