Using POST directly to query data is not very good, precisely for the reasons you talked about. If your search string is complex, perhaps you can simplify it by dividing the request process in two steps - one with POST and one with direct GET s.
The first step is to create a request template using POST . The request string is sent through the body of the message and becomes a new resource that users can request through GET . The query string allows you to use parameters similar to SQL queries. It's amazing what your query looks like, here is an example:
(userName = $name) || (createdBefore > $asOf && deleted=false)
Your users will POST this in the body of the message and return a new resource identifier. This resource identifies the parameterized "view" in your data. Let say that the resource identifier for this view is aabb02kjh . Now your users can request it as follows:
https:
This adds some complexity to your API, but allows users to define and reuse query templates with very simple and standard query strings.
source share