数据保存失败的 http 状态代码是什么

What will be the http status code for data save failed

通过 post 请求发送了 3 条数据。由于某种原因,它无法保存在数据库 table 中。例如,外键约束失败。 那么http状态码是什么?

500-599 保留用于 HTTP 响应状态代码中的服务器错误。

500 专门针对 Internal Server Error,您可以在发生验证错误时抛出该错误。

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses