Hi all,

I think we should make relevant changes in APIs to send 200 status code for
no content responses. This should only be done if the request is with query
or form params, but not for request with path parameters (Which is an exact
resource, should return 404).

Thanks
Geeth


*G. K. S. Munasinghe*
*Senior Software Engineer,*
*WSO2, Inc. http://wso2.com <http://wso2.com/> *
*lean.enterprise.middleware.*

email: [email protected]
phone:(+94) 777911226

On Tue, Jun 14, 2016 at 11:48 PM, Harshan Liyanage <[email protected]> wrote:

> Hi Geeth,
>
> Agreed. In such cases I guess sending 200 with empty body will be more
> appropriate because there are some cases where the server responds with 204
> when the service does not return data (i.e in some DELETE, POST requests).
>
> Thanks,
>
> Harshan Liyanage
> Senior Software Engineer
> Mobile: *+94724423048*
> Email: [email protected]
> Blog : http://harshanliyanage.blogspot.com/
> *WSO2, Inc. :** wso2.com <http://wso2.com/>*
> lean.enterprise.middleware.
>
> On Tue, Jun 14, 2016 at 12:42 PM, Geeth Munasinghe <[email protected]> wrote:
>
>> Hi Ayyoob
>>
>> On Tue, Jun 14, 2016 at 11:01 PM, Ayyoob Hamza <[email protected]> wrote:
>>
>>> Yes I agree with Harshan,
>>>
>>> It is a question about whether we are looking this as a resource or an
>>> endpoint. We should look at the url in the resource context(restful
>>> approach) even though it is built on top of http. Therefore IMO we need to
>>> think that we are mapping a resource to the url and therefore suitable
>>> response would be 404.
>>>
>>>
>> /devices/{device_idenitifier} - this should return 404 if requested for
>> non-existence device. I have no argument about it. But my concern is at
>> /devices?{query_parameter}. This is different. Actual resource is /devices,
>> but it returns no content due to filtering criteria associated with query
>> parameters, That is, in my opinion is a valid request which deserves a 200
>> or 204 response code.
>>
>> Thanks
>> Geeth
>>
>>
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to