Codici di stato HTTP
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
I seguenti codici di stato possono essere restituiti nelle risposte HTTP.
Codice HTTP |
Descrizione HTTP |
Note |
2xx |
OK |
Non è un errore; viene restituito in caso di esito positivo. Questo valore deve essere utilizzato anche per gli errori di logica di business
(ad es. booking_failure in
CreateBookingResponse
è compilato) |
400 |
Richiesta errata |
Richiesta non valida/Argomenti non validi (attività commerciale, servizio, spazio non trovato,
tentativo di prenotare uno spazio non valido, annullamento di una prenotazione che non è mai stata effettuata). |
401 |
Non autorizzato |
Non autenticato (credenziali non valide, riprova ad accedere). La richiesta non ha credenziali di autenticazione valide per l'operazione. |
403 |
Vietato |
Autorizzazione negata/vietata (chiamare è noto e rifiutato). Questa risposta
non deve essere utilizzata per i rifiuti causati dall'esaurimento di alcune
risorse (per questi errori, utilizza Too Many Requests ).
Forbidden non deve essere utilizzato se non è possibile identificare il chiamante (per questi errori, utilizza Unauthorized ). |
404 |
Non trovato |
Non trovata (risorsa non trovata, URL non valido, incluse RPC non valide) |
409 |
Conflitto |
L'operazione è stata interrotta, in genere a causa di un problema di concorrenza, ad esempio un errore di controllo del sequenziatore o l'interruzione della transazione. |
429 |
Troppe richieste |
È stata esaurita una risorsa, ad esempio una quota per utente, oppure
l'intero file system non dispone di spazio. |
499 |
Richiesta chiusa dal cliente |
L'operazione è stata annullata, in genere dal chiamante. |
500 |
Errore interno del server |
Errori interni. Ciò significa che alcune invarianti previste dal
sistema di base sono state violate. Questo codice di errore è riservato per
errori gravi. |
501 |
Non implementato |
L'operazione non è implementata o non è supportata/abilitata in questo
servizio. |
503 |
Servizio non disponibile |
Il servizio non è al momento disponibile. Molto probabilmente si tratta di una condizione transitoria, che può essere corretta riprovando con un backoff. |
504 |
Timeout del gateway |
La scadenza è scaduta prima del completamento dell'operazione. Per le operazioni che modificano lo stato del sistema, questo errore può essere restituito anche se l'operazione è stata completata correttamente. Ad esempio,
una risposta positiva da un server potrebbe aver subito un ritardo sufficientemente lungo
da far scadere la scadenza. |
A volte possono essere applicati più codici di errore. I servizi devono restituire il codice di errore più specifico applicabile.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 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 returned.\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 include 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,["# HTTP Status 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/local-services/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."]]