REST: Mapping 404 HTTP Status codes

后端 未结 2 1486
清歌不尽
清歌不尽 2021-01-11 12:25

Our team is developing RESTFul applications...we are debating the \"BEST PRACTICE\" approach.

Should 404 status code response be returned for a filter-like query? Sa

2条回答
  •  情深已故
    2021-01-11 12:45

    It may be more sensible to return a 204 code, which means 'No Content'. This would be slightly more efficient as a 204 status cannot have any document content, plus you can detect the code instead of having to parse the response.

提交回复
热议问题