Subject: [weirds] Empty search status code

From: "Linlin Zhou" <[email-masked]>
Date: Thu, 17 Apr 2014 13:00:29 +0800

Dear all,
I have a question about the empty search status code. 
When searching domain, nameserver or entity, server returns empty results. Currently, we handle query and search in the same, both return 404 if there is no informaiton to respond. But maybe the empty search information is something useful to client, responding 200 and empty result set makes sense as well. Which http code is proper, 200 or 404?

Regards,

Linlin Zhou

---

From: Andrew Newton <[email-masked]>
Date: Thu, 17 Apr 2014 09:09:22 -0500

For simple clients, a 404 is a simple check. And just because you
return a 404 doesn't mean you cannot also return a JSON response body
with empty results.

-andy

On Thu, Apr 17, 2014 at 12:00 AM, Linlin Zhou <[email-masked]> wrote:
> When searching domain, nameserver or entity, server returns empty results.
> Currently, we handle query and search in the same, both return 404 if there
> is no informaiton to respond. But maybe the empty search information is
> something useful to client, responding 200 and empty result set makes sense
> as well. Which http code is proper, 200 or 404?
>
> Regards,
> ________________________________
> Linlin Zhou
>
> _______________________________________________
> weirds mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/weirds
>

---

From: Simon Perreault <[email-masked]>
Date: Thu, 17 Apr 2014 10:53:30 -0400

> return a 404 doesn't mean you cannot also return a JSON response body

Whatever the outcome is (I don't care), please state it explicitly in
the next draft revision.

Thanks,
Simon
-- 
DTN made easy, lean, and smart --> http://postellation.viagenie.ca
NAT64/DNS64 open-source        --> http://ecdysis.viagenie.ca
STUN/TURN server               --> http://numb.viagenie.ca

---

From: "Linlin Zhou" <[email-masked]>
Date: Fri, 18 Apr 2014 09:32:53 +0800

So my take is,
#1 Just return 404
#2 Return 404 with empty results
#3 Return 200 with empty results

Both #1 and #2 are allowed in http draft. Right?

Regards,

Linlin Zhou
 
From: Andrew Newton
Date: 2014-04-17 22:09
To: Linlin Zhou
CC: weirds
Subject: Re: [weirds] Empty search status code
For simple clients, a 404 is a simple check. And just because you
return a 404 doesn't mean you cannot also return a JSON response body
with empty results.
 
-andy

---

From: "Linlin Zhou" <[email-masked]>
Date: Fri, 18 Apr 2014 09:48:36 +0800

Reread the http draft, in draft-ietf-weirds-using-http-08 section 5.3:
If a server wishes to respond that it has no information regarding the query, it returns a 404 response code. Optionally, it MAY include additional information regarding the negative answer in the HTTP entity body.I think this paragraph gives the explanation that 404 code with additional information is allowed.
Regards

Linlin Zhou
 
From: Simon Perreault
Date: 2014-04-17 22:53
To: weirds

Thanks,
Simon

---

From: Simon Perreault <[email-masked]>
Date: Fri, 18 Apr 2014 08:45:04 -0400

Le 2014-04-17 21:48, Linlin Zhou a écrit :
> If a server wishes to respond that it has no information regarding the query, it returns a 404 response code. Optionally, it MAY include additional information regarding the negative answer in the HTTP entity body.
> 
> I think this paragraph gives the explanation that 404 code with additional information is allowed.

In my understanding, this text means the server should return 200, since
an empty result set *is* information. But I'm not arguing that point, I
don't care. The fact that we have a different understanding of the
current text means that the current text is not sufficiently explicit.
That's why I said that the next draft revision should state the outcome
of this discussion explicitly. And I don't care what the outcome is. I
just want the text to be clear.

Simon

---

From: Andy Newton <[email-masked]>
Date: Fri, 18 Apr 2014 13:58:31 +0000

> just want the text to be clear.

Point taken. Perhaps it should be “answer 404 if there is no information that answers the query.”

However, I’d like it to stay 404 because that is an easy path for clients.

-andy

---

From: Simon Perreault <[email-masked]>
Date: Fri, 18 Apr 2014 10:02:52 -0400

> Point taken. Perhaps it should be “answer 404 if there is no information that answers the query.”

Not explicit enough. As I said, in my understanding an empty result set
*is* information that answers the query.

Suggestion: "If a search query yields an empty result set, the
response's status code MUST be XXX."

Pick XXX however you like.

> However, I’d like it to stay 404 because that is an easy path for clients.

Fine with me.

Simon

---

From: Andy Newton <[email-masked]>
Date: Fri, 18 Apr 2014 14:45:27 +0000

On Apr 18, 2014, at 10:02 AM, Simon Perreault <[email-masked]<mailto:[email-masked]>> wrote:

Works for me. Thanks.

-andy

---

From: Naoki Kambe <[email-masked]>
Date: Mon, 21 Apr 2014 13:02:00 +0900 (JST)

From: Andy Newton <[email-masked]>
Date: Fri, 18 Apr 2014 14:45:27 +0000
> On Apr 18, 2014, at 10:02 AM, Simon Perreault
> <[email-masked]<mailto:[email-masked]>>
> wrote:

I'm not quite sure about my understanding of this context.  

In a case of no result found, does this mean that returning an XXX
status code other than 404 is capable? 

I'm afraid that this might be confusion for clients.  They might not
know which status code the server returns before asking.  They might
check both a header and a body of the empty result depending on the
server response.

Regards,
Naoki Kambe

---

From: Andy Newton <[email-masked]>
Date: Wed, 23 Apr 2014 11:56:47 +0000

> check both a header and a body of the empty result depending on the

A client should check for 404. If the client wants more in-depth information, it can look at the response body.

-andy

---

From: Naoki Kambe <[email-masked]>
Date: Thu, 24 Apr 2014 11:36:14 +0900 (JST)

From: Andy Newton <[email-masked]>
Date: Wed, 23 Apr 2014 11:56:47 +0000
> A client should check for 404. If the client wants more in-depth
> information, it can look at the response body.

That makes sense to me. Thanks,

Naoki Kambe