StatusCode class

Gemini response status code

Gemini uses two-digit numeric status codes. Related status codes share the same first digit. Importantly, the first digit of Gemini status codes do not group codes into vague categories like "client error" and "server error" as per HTTP. Instead, the first digit alone provides enough information for a client to determine how to handle the response. By design, it is possible to write a simple but feature complete client which only looks at the first digit. The second digit provides more fine-grained information, for unambiguous server logging, to allow writing comfier interactive clients which provide a slightly more streamlined user interface, and to allow writing more robust and intelligent automated clients like content aggregators, search engine crawlers, etc. The first digit of a response code unambiguously places the response into one of six categories, which define the semantics of the Response.meta.

Constructors

StatusCode()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

knownStatusCodes List<int>
The list of all known status codes according to specification.
getter/setter pair

Static Methods

isClientCertificateRequired(int value) bool
Whether the status code is 6X CLIENT CERTIFICATE REQUIRED.
isFailure(int value) bool
Whether the status code is 4X TEMPORARY FAILURE or 5X PERMANENT FAILURE.
isInput(int value) bool
Whether the status code is 1X INPUT.
isKnown(int value) bool
Whether the status code is known according to specification.
isPermanentFailure(int value) bool
Whether the status code is 5X PERMANENT FAILURE.
isRedirect(int value) bool
Whether the status code is 3X REDIRECT.
isSuccess(int value) bool
Whether the status code is 2X SUCCESS.
isTemporaryFailure(int value) bool
Whether the status code is 4X TEMPORARY FAILURE.

Constants

badRequest → const int
59 BAD REQUEST
certificateNotAuthorised → const int
60 CERTIFICATE NOT AUTHORISED
certificateNotValid → const int
62 CERTIFICATE NOT VALID
cgiError → const int
42 CGI ERROR
clientCertificateRequired → const int
60 CLIENT CERTIFICATE REQUIRED The requested resource requires a client certificate to access. If the request was made without a certificate, it should be repeated with one. If the request was made with a certificate, the server did not accept it and the request should be repeated with a different certificate. The contents of Response.meta (and/or the specific 6x code) may provide additional information on certificate requirements or the reason a certificate was rejected.
gone → const int
52 GONE
input → const int
10 INPUT
notFound → const int
51 NOT FOUND
permanentFailure → const int
50 PERMANENT FAILURE
permanentRedirect → const int
31 REDIRECT - PERMANENT
proxyError → const int
43 PROXY ERROR
proxyRequestRefused → const int
53 PROXY REQUEST REFUSED
sensitiveInput → const int
11 SENSITIVE INPUT
serverUnavailable → const int
41 SERVER UNAVAILABLE
slowDown → const int
44 SLOW DOWN
success → const int
20 SUCCESS
temporaryFailure → const int
40 TEMPORARY FAILURE
temporaryRedirect → const int
30 REDIRECT - TEMPORARY