HTTP status while POST with incorrect data (using id of resource which does not exist)

后端 未结 3 2056
失恋的感觉
失恋的感觉 2021-02-10 04:43

What would be the correct HTTP status to return when I am performing the POST request to create a new user, but one of its parameters is incorrect - the company

3条回答
  •  太阳男子
    2021-02-10 05:14

    Here, this picture is very good, and I've used it many times.

    Which code should I return?

    I'd go with 404. The resource could exist (not a format error) but it just doesn't (and hence can't be found).

提交回复
热议问题