-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
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... 😞 It would send something like |
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
The text was updated successfully, but these errors were encountered: