开发者

Response code when POST fails to complete

I have a scenario where a client Posts to a resource and if the data in the post is not valid then I want to ret开发者_StackOverflow社区urn back a error saying what caused the failure. I am thinking that a 409 with a response body is appropriate? anyone any thoughts or suggestions on a different response?

Cheers,

Chris


  • 400 means the request as such was not understood (e.g. bad syntax)
  • 409 means request understood but there is a conflict the client might solve (e.g with PATCH)
  • 415 means the submitted media type is not understood by server
  • 422 means the data was syntactically correct but semantically wrong

What do you mean by 'not valid' HTH,

Jan

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜