rest - What API response should I send when a consumer asks for a collection of resources related to a resource that doesn't exist? -


let's have resource

/providers/123 

when consumer sends that, receives 200 ok , record provider identified 123, or 404 not found if there no provider id 123. fine.

now let's have resource

/providers/123/publications 

which represents collection of publications authored provider 123. when consumer sends that:

  • if provider exists , has publications, 200 ok collection of publications.
  • if provider exists , has no publications, 200 ok collection empty.

but if provider doesn't exist? 404? 200 empty set? 200 empty set , warning? else?

404 sure. url refers resource not exist.

don't give more information required.


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -