Which HTTP code to use for an empty subresource in a REST API?
问题 Let's say I've a resource articles at /articles . These articles may have related articles, so I fetch them by GETting /articles/{id}/related . What should I return is there is no related articles? I can think of: 404 Not Found , maybe with an empty collection 204 No Content 200 Found with an empty collection Any advices? (please give arguments) By the way, it may applies to pagination. If I request page 3 of 2, then the page 3 will return an empty set, should It be a 404 ? 回答1: 404 is not