状态响应代码
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 响应可返回以下状态代码。
HTTP 代码 |
HTTP 说明 |
备注 |
2xx |
确定 |
不是错误信息;成功时返回此项。这也应用于业务逻辑失败的情况(例如,CreateBookingResponse 中的 booking_failure 已填充) |
400 |
请求无效 |
请求无效/参数无效(未找到商家、服务和空档,尝试预订无效空档、取消不存在的预订)。 |
401 |
未经授权 |
未通过身份验证(凭据无效,请重试登录)。请求没有执行相应操作的有效身份验证凭据。 |
403 |
禁止 |
权限被拒绝/禁止(调用方已知且被拒)。如果遭拒的原因是部分资源已用尽,则不得使用此响应(请改用 Too Many Requests 来表示此类错误)。
如果无法识别调用方,则不得使用 Forbidden (请改用 Unauthorized 来表示此类错误)。 |
404 |
未找到 |
未找到(未找到相应资源;网址无效;包含无效的 RPC) |
409 |
冲突 |
操作已中止,通常是由于序列器检查失败或事务中止等并发问题。 |
429 |
请求过多 |
部分资源已用尽,可能是每用户配额不足,也可能是整个文件系统的存储空间已用完。 |
499 |
客户关闭了请求 |
操作已取消(通常是被调用者取消)。 |
500 |
内部服务器错误 |
内部错误。这意味着底层系统所期望的一些不变量已损坏。此错误代码保留用于严重错误。 |
501 |
未实现 |
操作在此服务中未实现或不受支持/未启用。 |
503 |
服务不可用 |
该服务目前不可用。这很可能是一种暂时情况,可以通过退避重试来纠正。 |
504 |
网关超时 |
期限已到,但操作尚未完成。对于更改系统状态的操作,即使操作已成功完成,也可能会返回此错误。例如,服务器的成功响应延迟时间过长,截止期限已过。 |
有时可能有多个错误代码都适用。服务应返回适用且最具体的错误代码。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eHTTP status codes indicate the outcome of a request, ranging from success (2xx) to various error types.\u003c/p\u003e\n"],["\u003cp\u003eClient errors (4xx) signal issues with the request itself, such as invalid credentials (401) or missing resources (404).\u003c/p\u003e\n"],["\u003cp\u003eServer errors (5xx) indicate problems on the server side, including internal errors (500) or service unavailability (503).\u003c/p\u003e\n"],["\u003cp\u003eWhen multiple error codes apply, the most specific one should be used.\u003c/p\u003e\n"],["\u003cp\u003eBusiness logic failures, despite not being technical errors, should utilize a 2xx status code with further details provided in the response body.\u003c/p\u003e\n"]]],["HTTP responses can include various status codes: 2xx signifies success, used even for business logic failures. 400 indicates bad requests, 401 for unauthorized access, and 403 for forbidden actions. 404 means resource not found, 409 a conflict, and 429 too many requests. 499 denotes client-canceled operation, 500 internal errors, 501 unimplemented features, 503 service unavailability, and 504 gateway timeout. The most specific error code should be used when multiple codes apply.\n"],null,["# Status Response Codes\n\nThe following status codes can be returned in HTTP responses.\n\n| HTTP Code | HTTP Description | Notes |\n|-----------|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 2xx | OK | Not an error; returned on success. This should also be used for business logic failures (e.g. `booking_failure` in [`CreateBookingResponse`](/actions-center/verticals/reservations/waitlists/reference/booking-server-api-rest/e2e-methods/createbooking-method) is populated) |\n| 400 | Bad Request | Bad Request/Invalid Arguments (merchant, service, slot not found, trying to book an invalid slot, cancelling a booking that never existed). |\n| 401 | Unauthorized | Unauthenticated (invalid credentials, retry login). The request does not have valid authentication credentials for the operation. |\n| 403 | Forbidden | Permission denied/forbidden (caller is known and rejected). This response must not be used for rejections caused by exhausting some resource (use `Too Many Requests` instead for those errors). `Forbidden` must not be used if the caller can not be identified (use `Unauthorized` instead for those errors). |\n| 404 | Not Found | Not found (Resource not found, invalid url, including invalid RPCs) |\n| 409 | Conflict | The operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort. |\n| 429 | Too Many Requests | Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. |\n| 499 | Client Closed Request | The operation was cancelled, typically by the caller. |\n| 500 | Internal Server Error | Internal errors. This means that some invariants expected by the underlying system have been broken. This error code is reserved for serious errors. |\n| 501 | Not Implemented | The operation is not implemented or is not supported/enabled in this service. |\n| 503 | Service Unavailable | The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff. |\n| 504 | Gateway Timeout | The deadline expired before the operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. |\n\nSometimes multiple error codes may apply. Services should return the most\nspecific error code that applies."]]