Which HTTP code to use, in a REST API, for a subresource if the parent resource doesn't exist?
问题 My team and I are coding a REST API, but some concepts are still not fully understood. In a given resource: objective/{id}/goal where goal is collection If the consumer tries to reach an objective that doesn't exist, the API will return status code 404 , pretty simple. ex: objective/999 returns 404 For some reason the consumer tries to fetch the goals from this non existing resource: ex: objective/999/goal returns ? Which is the most suitable code to return? I have a feeling that this should