
Cover image by Edwin Young, on Flickr.
When we are designing APIs the goal is to give our users some amount of power over the service we provide. ...
For further actions, you may consider blocking this person and/or reporting abuse
I tend to favor query strings for a few reasons. Aside from the theological beliefs, a few of the reasons are concrete or footgun-avoidance :)
Although that’s technically true, you’ll most likely trigger the CORS preflight check anyway due to the Content-Type as it’s quite unlikely you’ll be using one of the plain-text or form data types.
I don't really see the point of your criticism of the practice of having multiple URI parameters with the same name. You point out that some developers might add parameters to an overly simplistic data structure like a map, before encoding the map as URI parameters, and that they might lose data that way unless they used a more complex procedure to build the URI. That's certainly true, but it would be a silly mistake to make, and the alternative you suggest, of encoding multiple parameter values as a comma-separated string, is no less complex.
I just had a common JavaScript data structure in mind.
But you are probably right, doing
filters.names.join(",")
isn't much simpler thanfilters.names.map(n => "name=" + n).join("&")
.