web services - REST: Mapping 404 HTTP Status codes -


our team developing restful applications...we debating "best practice" approach.

should 404 status code response returned filter-like query? url

.../1/service/startswith/a.json

and returns values start in database...but if no "a" values found should return status code 200 empty json string? or status code 404.

thanks!

see this question, in update answer address issue. bit,

i think answer whether return 404 depends on resource being retrieved. representation of search result, or representation of product? know need @ link relation led url.

if url supposed return product representation 404 should returned if code not exist. if url returns search result shouldn't return 404.

the end result url looks not determining factor. having said that, convention query strings used return search results more intuitive use style of url when don't want return 404s.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -