Unexpected query string when passing params containing an array
The documentation is unclear on the expected behaviour of this, but it's unexpected to me. I'm invoking something like:
Vue.http.get('http://somewhere/something',` { params: { field: ['a', 'b'] } })That is, I want to pass a query parameter containing a list of values. Naively, I expect the query string to be: http://somewhere/something?field=a&field=b
But instead I get: http://somewhere/something?field[]=a&field[]=b
(the [] are URL encoded, I've decoded them head to make it more obvious)
Is this expected? I can't find any tests that explore this. In my experience, at least with java as the endpoint, if you're expecting an array of values, you just repeat the query parameter, you don't put "[]" on the end. I can't actually find a workaround to this. I can't find a method of constructing the query string I want, except for doing it manually and passing the result in as the URL.
Source: pagekit/vue-resource