如果用户在调用确认端点之前没有上传所需的文件,从 REST API 到 return 的 HTTP 状态代码是什么?

What HTTP Status Code to return from REST API if user has not upload required files before calling confirm endpoint?

如果用户必须通过 API 端点调用上传文件并确认它们,如果用户调用确认端点但尚未上传所有必需的文件,应返回什么状态代码?

400好像不对,因为请求参数没有问题
403好像不对,因为凭证没有问题。

The 403 (Forbidden) status code indicates that the server understood the request but refuses to fulfill it.... a request might be forbidden for reasons unrelated to the credentials. -- HTTP Semantics

请记住,状态代码是 transfer of documents over a network 域中的元数据;它们告诉 HTTP 组件如何解释 HTTP 响应中的字段和正文。

另见 generic semantics of status codes 上的 Mark Nottingham。


我认为这不是一个好的选择,但它 409 conflict 是一个可能无害的替代方案?

The 409 (Conflict) status code indicates that the request could not be completed due to a conflict with the current state of the target resource. This code is used in situations where the user might be able to resolve the conflict and resubmit the request. -- HTTP Semantics