3 ms·
>The REST-inspired API that requires 10,000 API calls to do something that could be done in 1. That should be a non-issue. Consider search queries. They are
by Falkon1313 10y ago
>The REST-inspired API that requires 10,000 API calls to do something that could be done in 1.
That should be a non-issue. Consider search queries. They are a simple GET request that returns a collection of many results in one response. You can do the same, you just need to define collection resources or collection semantics for existing resources.
The only challenge is handling partial failures, like when you POST 1000 things, and 22 of them fail validation. So each thing needs a status code in the response and some unique ID so that you can find its status code in the response. (That is separate from the overall request status code.) I have the client send a UUID and the server responds with a collection keyed by that UUID so that it's easy to find, for each thing that you sent, what happened.
- rv11 10y agoon search queries, consider twitter search, I have read it is not REST because it is not idempotent