Kode Respons Status
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Kode status berikut dapat ditampilkan dalam respons HTTP.
Kode HTTP |
Deskripsi HTTP |
Catatan |
2xx |
Oke |
Bukan error; ditampilkan jika berhasil. Ini juga harus digunakan untuk kegagalan logika bisnis
(misalnya, booking_failure di
CreateBookingResponse
diisi) |
400 |
Permintaan Tidak Valid |
Permintaan Buruk/Argumen Tidak Valid (penjual, layanan, slot tidak ditemukan,
mencoba memesan slot yang tidak valid, membatalkan pemesanan yang tidak pernah
ada). |
401 |
Tidak diotorisasi |
Tidak diautentikasi (kredensial tidak valid, coba lagi login). Permintaan tidak memiliki kredensial autentikasi yang valid untuk operasi tersebut. |
403 |
Terlarang |
Izin ditolak/terlarang (pemanggil dikenal dan ditolak). Respons
ini tidak boleh digunakan untuk penolakan yang disebabkan oleh kehabisan beberapa
resource (sebagai gantinya, gunakan Too Many Requests untuk error tersebut).
Forbidden tidak boleh digunakan jika pemanggil tidak dapat
diidentifikasi (gunakan Unauthorized untuk error tersebut). |
404 |
Tidak Ditemukan |
Tidak ditemukan (Sumber daya tidak ditemukan, url tidak valid, termasuk RPC tidak valid) |
409 |
Konflik |
Operasi dibatalkan, biasanya karena masalah konkurensi seperti
kegagalan pemeriksaan sequencer atau pembatalan transaksi. |
429 |
Terlalu Banyak Permintaan |
Beberapa resource telah habis, mungkin kuota per pengguna, atau mungkin seluruh sistem file kehabisan ruang. |
499 |
Klien Menutup Permintaan |
Operasi dibatalkan, biasanya oleh pemanggil. |
500 |
Error Server Internal |
Error internal. Artinya, beberapa invarian yang diharapkan oleh
sistem pokok telah rusak. Kode error ini disediakan untuk
error yang bersifat serius. |
501 |
Tidak Diterapkan |
Operasi tidak diterapkan atau tidak didukung/diaktifkan dalam layanan
ini. |
503 |
Layanan Tidak Tersedia |
Saat ini layanan tidak tersedia. Kemungkinan besar ini hanya kondisi sementara, yang dapat diperbaiki dengan mencoba kembali menggunakan backoff. |
504 |
Waktu Tunggu Gateway Habis |
Batas waktu berakhir sebelum operasi selesai. Untuk operasi yang mengubah status sistem, error ini dapat ditampilkan, meskipun operasi tersebut telah selesai. Misalnya,
respons berhasil dari server dapat tertunda selama waktu yang cukup lama
hingga tenggat waktu berakhir. |
Terkadang beberapa kode error mungkin berlaku. Layanan harus menampilkan kode error paling spesifik yang berlaku.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-26 UTC.
[null,null,["Terakhir diperbarui pada 2025-07-26 UTC."],[[["\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 like bad requests, authentication failures, or missing resources.\u003c/p\u003e\n"],["\u003cp\u003eServer errors (5xx) represent problems on the server side, such as internal errors or service unavailability.\u003c/p\u003e\n"],["\u003cp\u003eSpecific error codes provide detailed information about the nature of the problem, enabling appropriate action.\u003c/p\u003e\n"],["\u003cp\u003eWhen multiple error codes could apply, the most specific one should be used.\u003c/p\u003e\n"]]],["HTTP responses can include various status codes. Successful operations return a 2xx code. Client-side errors include 400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), 429 (Too Many Requests), and 499 (Client Closed Request). Server-side errors are 500 (Internal Server Error), 501 (Not Implemented), 503 (Service Unavailable), and 504 (Gateway Timeout). The most specific error code should be returned 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/e2e/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."]]