Answer the question
In order to leave comments, you need to log in
How to make a method with complex filtering in REST?
Good afternoon.
Here is a description of the standard REST implementation.
What is the best way, without departing from the meaning, to add a method that will pass complex JSON to Body for filtering? According to the idea, it should be GET, but even my server will reject such a request (GET + JSON Body) JSON Body
is needed, without using Headers.
Answer the question
In order to leave comments, you need to log in
1. in rest for url it is not typical to use uppercase characters. It is worth replacing TodoItems with todo-items
2. It is typical to use GET parameters for filtering. Usually, all sorts of different parameters are passed for this, like filter, limit, page, etc. and they work great
3. if you really really want complex filtering by requests in the body, then GraphQL
4 is now used for this. so only if you really understand what you are doing"
5. the topmost method you have and should also be a filter
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question