
Ask HN: Would allowing multiple querystrings in URLs allow more scalable APIs? - kizer
Imagine if could GET
`https:&#x2F;&#x2F;bar.mywebsite.foo&#x2F;gadgets?name=foo&amp;age&gt;=100&#x2F;gizmo&#x2F;components?type=types.gizmo.component.square`.<p>I know it&#x27;s ugly and not legal URI syntax, but this could cut N GETS into one, where, as one possibility, the server could compile the path into the separate requests (if necessary). Then again, I guess this transformation could happen client-side.<p>It seems like repeated filtering is always involved in getting some desired resource; it would be great to get this with one request. Perhaps that newcomer GraphQL addresses this by design.<p>Often I wonder if the best HTTP API would involve the remote execution of some non-turing-complete query-language guaranteed to terminate. Just select, filter, basic &quot;joins&quot;, etc.
======
scarface74
I think you are describing OData.

[https://www.odata.org/documentation/odata-version-2-0/uri-
co...](https://www.odata.org/documentation/odata-version-2-0/uri-conventions/)

~~~
kizer
Correct me if I'm wrong, but it looks like you can't just keep going and
appending more to the path; the metadata document seems to dictate how
parameters are applied to resources in the preceding path.

~~~
scarface74
Never used OData. It just popped into my head when I saw the question.

~~~
kizer
I had just heard of it. Looks like what I was getting at. Wish APIs were just
exposed through some query language. Don't see apparent harm if it's read-only
and permission-restricted.

