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

Am 05.11.2020 um 12:06 schrieb Stephane Bortzmeyer:
> On Wed, Nov 04, 2020 at 08:24:59AM -0500,
>   Sawood Alam <ibnesayeed@gmail.com> wrote
>   a message of 105 lines which said:
>
>> The question remains open, "how to express a successful SEARCH
>> response with an unsuccessful search result when returning an entity
>> body is desired?" Does it warrant a new 2xx status code? I think
>> this will be a common situation for many people who would be willing
>> to migrate their GET-style searching where they could use a 404 to
>> express it.
>
> Note that there was a very similar discussion during the
> standardization of DNS-over-HTTPS (RFC 8484). The decision was that
> 200 is the proper code even if the DNS request was unsuccessful. To
> quote the RFC "For example, a successful 2xx HTTP status code is used
> even with a DNS message whose DNS response code indicates failure,
> such as SERVFAIL or NXDOMAIN."
>
> The rationale being "HTTP succeeded, so 200, even if DNS failed".

That's IMHO the "tunnel other protocol over HTTP" approach which we
should avoid.

> Replace DNS by SEARCH and I think the reasoning still holds.

If the SEARCH request fails because the query is malformed, it should
return a 4xx. If the SEARCH request suceeds, but there is search result,
a 2xx is the right answer.

Best regards, Julian

Received on Thursday, 5 November 2020 11:35:20 UTC