Proper REST response for empty table?

后端 未结 5 1004
遇见更好的自我
遇见更好的自我 2020-11-29 19:02

Let\'s say you want to get list of users by calling GET to api/users, but currently the table was truncated so there are no users. What is the prop

5条回答
  •  清酒与你
    2020-11-29 19:39

    It must 200 OK with empty list.

    Why: Empty table means the table exists but does not have any records.

    404 Not Found means requested end point does not exist.

提交回复
热议问题