Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
samples html_form_post.js fails #1713
Comments
Thanks for reporting this, I'm not sure how nobody noticed we had a wrong example for 4 years... |
For more details, k6 doesn't deal well with complex types when it tries to urlencode them. It really can't deal with that, since there isn't a standard for how to encode maps and arrays into URL parameters for Though, as shown in #878, k6 would currently do something that is definitely wrong... |
K6 http.post method isn't correctly encoding a list of values assigned to a key in an object.
The simplest way to see this is to run the sample at
https://github.com/loadimpact/k6/blob/master/samples/html_form_post.js and note that it fails.
The list of toppings should be passed as multiple values for the same key, but it is instead having the values stringified and passed as one value.
With this issue, it's difficult to pass multiple select check boxes with the same name or multi-selections in a select.
Environment
Expected Behavior
The topping values should be encoded as
topping=onion&topping=bacon&topping=cheese
and the sample should pass all checks.
Actual Behavior
Test case fails because the topping values are encoded as (and URI encoded)
topping=[onion bacon cheese]
Steps to Reproduce the Problem