3 ms·
> Why not simplify by removing parameters from the URL altogether? Caching. Put a caching proxy in front of your api endpoint and enjoy. This is the same reas
by nothrabannosir 12y ago
> Why not simplify by removing parameters from the URL altogether?
Caching. Put a caching proxy in front of your api endpoint and enjoy.
This is the same reason you'll want to do:
/api/customer/1234/order/abcd
instead of:
/api?customer=1234&order=abcd
Because even if your cache includes query strings (which it may, and you can configure it to), you lose order. Now you also have to configure your cache to ignore ordering on the query string, and that's a lot less obvious (and probably not even HTTP compliant?).
- spinlock 12y agoI feel like the author is advocating for an easy API over a _simple_ API. Yes, the author's ideas make programming easy. There's less cruft and it's faster to develop. But, he's loosing simplicity. REST is a simple API because you don't need things like ordering, etc... That makes it compossible with other simple technologies (like the caching proxy you mentioned).
- mborch 12y agoJust require query string to be sorted. In Python: urllib.urlencode(sorted(params.items()))