Skip to content

Query String Parameters

Parameters List Styles

If you want to pass a list/array as a query string parameter, there is no universally accepted way to do this. By default, halchemy will serialize the list as multiple parameters with the same name. For example, {"list":["a","b","c"]} will be serialized as list=a&list=b&list=c. You can change how lists are serialized by setting the parameters list style.

Given this parameters object: {"list":["a","b","c"]}, each parameters list style serializes it to the query string as follows:

StyleQuery String
repeat_key (default)list=a&list=b&list=c
bracketlist[]=a&list[]=b&list[]=c
indexlist[0]=a&list[1]=b&list[2]=c
commalist=a,b,c
pipelist=a|b|c

Released under the MIT License.

Released under the MIT License.