Hi Madhawa, We also had a similar doubt as to what status code we should return in a situation where there is no content. Concern we had was, in a call to 'getDevies', it returns 404 when no device is found (no resources found), where we thought it should return 204 (no content) instead of 404 or 200.
But there were certain things that need to be considered when we are deciding on those status codes. For an example, we have to decide whether the endpoints is designed to return single resource or a collection, what is the intended behavior and is this (no content) scenario is an acceptable return from the endpoint etc. Anyhow, if this situation matches yours, you can go through the email thread [1] which would help you to get a better understanding on this. Briefing the conclusion, we have agreed to return an empty set with a 200 status code in our case. [1] [EMM] Why we are using 404 for "No Content" responses ? Thank you Best Regards, Madhawa On Tue, Jun 28, 2016 at 4:52 PM, Madhawa Gunasekara <[email protected]> wrote: > Hi All, > > We set 202 (Accepted) status code for the response when there isn't > content message body. but AFAIU We have to set 204 (No Content) for > successful responses where there isn't a content message body [1]. > > This issue is reported in [2]. > > Highly appreciated your thoughts on this. > > [1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html > [2] https://wso2.org/jira/browse/DS-886 > > Thanks, > Madhawa > > -- > *Madhawa Gunasekara* > Software Engineer > WSO2 Inc.; http://wso2.com > lean.enterprise.middleware > > mobile: +94 719411002 <+94+719411002> > blog: *http://madhawa-gunasekara.blogspot.com > <http://madhawa-gunasekara.blogspot.com>* > linkedin: *http://lk.linkedin.com/in/mgunasekara > <http://lk.linkedin.com/in/mgunasekara>* > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Madhawa Perera *Software Engineer* Mobile : +94 (0) 773655496 <%2B94%20%280%29%20773%20451194> [email protected]
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
