Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Would allowing multiple querystrings in URLs allow more scalable APIs?
3 points by kizer on Sept 12, 2019 | hide | past | favorite | 4 comments
Imagine if could GET `https://bar.mywebsite.foo/gadgets?name=foo&age>=100/gizmo/components?type=types.gizmo.component.square`.

I know it'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.

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.

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 "joins", etc.




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.


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


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: