【发布时间】:2012-06-01 08:52:51
【问题描述】:
我有一个类似 sales/customers/{customerno} 的资源。如果客户端向该资源发送 PUT 请求,我将返回 400 - 如果实体正文中的 xml 不是有效的 xml,则请求错误。但是如果 xml 有效,但 xml 的内容无效怎么办。例如,客户正在尝试更新客户 PostCode 并提供无效的 PostCode。在这种情况下返回 400 - Bad request 是否正确,还是我应该使用的另一个 http 代码?
【问题讨论】:
标签: xml rest http-status-codes restful-architecture http-status-code-400