As part of a REST Service, I need to implement a search call. The basic idea is that the user can POST a new search, and GET the results:
POST http://localhost/api/search
GET http://localhost/api/search?id=123
However, my search may run a few minutes, and return partial results until it is done. That is, the GET-Request would return something like:
status: running
results: a, b, c.
while the next GET-Request might return
status: completed
results: a, b, c, d, e.
This contradicts the semantics of a RESTful GET request. The request should always return the same result when called several times. For example, when the user uses a caching proxy, the full results might never be delivered to the user.
Question: Is there any way to provide a truly RESTful implementation for long running searches with partial results?