Re: How to express no matching results in HTTP SEARH method?

Am 04.11.2020 um 03:40 schrieb Sawood Alam:
> Hi,
>
> What would be an appropriate status code if the target resource of the
> SEARCH method wants to provide an entity to convey that the search
> operation yielded no results? In traditional GET-style searching, one
> could return a 404, would that still be an option (I doubt it as it
> would mean the target resource itself that performs the search is not
> found)?

That would be my interpretation as well.

> The specification seems to suggest usage of 204, but in that case no
> content can be returned in the response, which may be desired in some

...in which case, you wouldn't have to use a 204.

> cases. Also, 204 is a success response, which means a client might
> repeat the request, while a 4xx response would suggest that there is no
> point in repeating the request without making changes to it.

If the request target exists, and accepts and processes the query, the
response ought to be a 2xx, no?

Best regards, Julian

Received on Wednesday, 4 November 2020 12:59:24 UTC