RE: Proposed resolution for ISSUE-64 (status codes)

On 1 Aug 2014 at 00:57, Gregg Kellogg wrote:
> On Jul 31, 2014, at 12:38 PM, Markus Lanthaler wrote:
>> On 30 Jul 2014 at 13:25, Gregg Kellogg wrote:
>>> Does this imply that if LD Fragments are used for Hydra Collections
>>> that you could not return an empty collection? Returning an empty
>>> collection would be useful for describing operations, say, to add
>>> something to the collection.
>> 
>> No, it didn't imply that. A 404 can include a response body which means
>> you can return an empty collection.
> 
> Not useful if you're using your API also as a website; A web browser
> won't act too kindly to a 404 response, even with a body, AFAIK.

If a body is returned, a browser will display it exactly the same way as if
the status code were 200.


> Also, there's a difference between trying to fetch an empty
> collection, and an undefined collection. It's for the undefined case
> that a 404 is most useful; arguably, this is true for pure LDF as
> well.

+1 I'm quite strongly against using a 404 to signal an empty result. In my
opinion this should clearly be a 200. There was no error, neither on the
client nor the server side.


--
Markus Lanthaler
@markuslanthaler

Received on Friday, 1 August 2014 04:55:15 UTC