[OTDev] filtering resources returns empty list : 404 or 200 ?
chung chvng at mail.ntua.grWed May 4 10:22:14 CEST 2011
- Previous message: [OTDev] filtering resources returns empty list : 404 or 200 ?
- Next message: [OTDev] filtering resources returns empty list : 404 or 200 ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Martin, All, I think should be 200, since the request is successful and in fact contains the response that corresponds to the request - so everything has gone as expected. The fact that it is empty does not raise a 404 in my opinion. Think of it from the client side: you have a client method like : listResources(URI uri, SearchParam param)::List<URI> throws ServiceInvocationException What do you expect from this method in case the server returns an empty list? I guess the answer is to return an *empty list* and not throw an error. Error 404 is to be thrown if the request is applied on a non-existing resource like http://server.com/asdf?search=test Best regards, Pantelis On Tue, 2011-05-03 at 14:05 +0200, Martin Guetlein wrote: > Hello All, > > when filtering a OpenTox resource list with a search param (e.g. > http://apps.ideaconsult.net:8080/ambit2/dataset?search=test), > should the status code be 404 (not found), or 200 for an empty list? (e.g. > http://apps.ideaconsult.net:8080/ambit2/dataset?search=emptylist) > > I would vote for 200 (more consistent to an un-filtered list of resources, > e.g. http://apps.ideaconsult.net:8080/ambit2/dataset). > > (On the other hand, 404 might be more intuitive, e.g.: No, there is no > validation for model 120732: > http://opentox.informatik.uni-freiburg.de/validation?model=http://apps.ideaconsult.net:8080/ambit2/model/130732 > ) > > Both is fine for me, but we should agree on a common solution. > > Regards, > Martin > <http://opentox.informatik.uni-freiburg.de/validation?model=ambit> >
- Previous message: [OTDev] filtering resources returns empty list : 404 or 200 ?
- Next message: [OTDev] filtering resources returns empty list : 404 or 200 ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Development mailing list