In a Restful API, it is better to use GET to list a collection. However, in our scenario, we allow people query with a list of parameters (say CodeList) and then return details.
As we allow upto 500 codes in the codelist parameter, it is possible that the size limit of 2,048 characters for a GET url is not enough. What is good way to handle this? I can think of two options:
- Just use POST to return a list of collection.
- Still use GET, but put the parameter in request body other than request url.
From a API design point of view, which option is bit better? Or maybe there are better options I am not aware of?