3 ms·
Yes, path segment parameters are a rather interesting (but mostly historical) curiosity. Recently I have begun using them in a few of my internal APIs, where i
by kiwidrew 10y ago
Yes, path segment parameters are a rather interesting (but mostly historical) curiosity.
Recently I have begun using them in a few of my internal APIs, where it is useful to have a distinction between "parameters used to filter a set of items" and "parameters used to request items in a particular format"... an example:
GET /v1/tickets;status=closed;milestone=100?fields=id,title,reporter&sort=-last_updated
Pro: this nicely addresses the problem of collisions between the names of data fields (such as "title") and the names of response-modifying parameters (such as "sort").
Con: consumers of your API get to discover the joys of RFC 3986, because there is essentially zero support for path segment parameters in modern HTTP libraries.