HttpStatus abstract#
HTTP status codes. Exported in dart:io and dart:html.
Constructors#
HttpStatus()#
Properties#
hashCode no setter inherited#
The hash code for this object.
A hash code is a single integer which represents the state of the object that affects operator == comparisons.
All objects have hash codes. The default hash code implemented by Object represents only the identity of the object, the same way as the default operator == implementation only considers objects equal if they are identical (see identityHashCode).
If operator == is overridden to use the object state instead, the hash code must also be changed to represent that state, otherwise the object cannot be used in hash based data structures like the default Set and Map implementations.
Hash codes must be the same for objects that are equal to each other according to operator ==. The hash code of an object should only change if the object changes in a way that affects equality. There are no further requirements for the hash codes. They need not be consistent between executions of the same program and there are no distribution guarantees.
Objects that are not equal are allowed to have the same hash code. It is even technically allowed that all instances have the same hash code, but if clashes happen too often, it may reduce the efficiency of hash-based data structures like HashSet or HashMap.
If a subclass overrides hashCode, it should override the operator == operator as well to maintain consistency.
Inherited from Object.
Implementation
external int get hashCode;
runtimeType no setter inherited#
A representation of the runtime type of the object.
Inherited from Object.
Implementation
external Type get runtimeType;
Methods#
noSuchMethod() inherited#
Invoked when a nonexistent method or property is accessed.
A dynamic member invocation can attempt to call a member which doesn't exist on the receiving object. Example:
dynamic object = 1;
object.add(42); // Statically allowed, run-time error
This invalid code will invoke the noSuchMethod method
of the integer 1 with an Invocation
representing the
.add(42) call and arguments (which then throws).
Classes can override noSuchMethod to provide custom behavior for such invalid dynamic invocations.
A class with a non-default noSuchMethod invocation can also omit implementations for members of its interface. Example:
class MockList<T> implements List<T> {
noSuchMethod(Invocation invocation) {
log(invocation);
super.noSuchMethod(invocation); // Will throw.
}
}
void main() {
MockList().add(42);
}
This code has no compile-time warnings or errors even though
the MockList class has no concrete implementation of
any of the List interface methods.
Calls to List methods are forwarded to noSuchMethod,
so this code will log an invocation similar to
Invocation.method(#add, [42])
and then throw.
If a value is returned from noSuchMethod,
it becomes the result of the original invocation.
If the value is not of a type that can be returned by the original
invocation, a type error occurs at the invocation.
The default behavior is to throw a NoSuchMethodError.
Inherited from Object.
Implementation
@pragma("vm:entry-point")
@pragma("wasm:entry-point")
external dynamic noSuchMethod(Invocation invocation);
toString() inherited#
A string representation of this object.
Some classes have a default textual representation,
often paired with a static parse function (like int.parse).
These classes will provide the textual representation as
their string representation.
Other classes have no meaningful textual representation
that a program will care about.
Such classes will typically override toString to provide
useful information when inspecting the object,
mainly for debugging or logging.
Inherited from Object.
Implementation
external String toString();
Operators#
operator ==() inherited#
The equality operator.
The default behavior for all Objects is to return true if and
only if this object and other are the same object.
Override this method to specify a different equality relation on a class. The overriding method must still be an equivalence relation. That is, it must be:
Total: It must return a boolean for all arguments. It should never throw.
Reflexive: For all objects
o,o == omust be true.-
Symmetric: For all objects
o1ando2,o1 == o2ando2 == o1must either both be true, or both be false. -
Transitive: For all objects
o1,o2, ando3, ifo1 == o2ando2 == o3are true, theno1 == o3must be true.
The method should also be consistent over time, so whether two objects are equal should only change if at least one of the objects was modified.
If a subclass overrides the equality operator, it should override the hashCode method as well to maintain consistency.
Inherited from Object.
Implementation
external bool operator ==(Object other);
Constants#
deprecated ACCEPTED#
DEPRECATED
Use accepted instead
Implementation
@Deprecated("Use accepted instead")
static const int ACCEPTED = accepted;
accepted#
Implementation
static const int accepted = 202;
alreadyReported#
Implementation
static const int alreadyReported = 208;
deprecated BAD_GATEWAY#
DEPRECATED
Use badGateway instead
Implementation
@Deprecated("Use badGateway instead")
static const int BAD_GATEWAY = badGateway;
deprecated BAD_REQUEST#
DEPRECATED
Use badRequest instead
Implementation
@Deprecated("Use badRequest instead")
static const int BAD_REQUEST = badRequest;
badGateway#
Implementation
static const int badGateway = 502;
badRequest#
Implementation
static const int badRequest = 400;
clientClosedRequest#
Implementation
static const int clientClosedRequest = 499;
deprecated CONFLICT#
DEPRECATED
Use conflict instead
Implementation
@Deprecated("Use conflict instead")
static const int CONFLICT = conflict;
conflict#
Implementation
static const int conflict = 409;
connectionClosedWithoutResponse#
Implementation
static const int connectionClosedWithoutResponse = 444;
deprecated CONTINUE#
DEPRECATED
Use continue_ instead
Implementation
@Deprecated("Use continue_ instead")
static const int CONTINUE = continue_;
continue_#
Implementation
static const int continue_ = 100;
deprecated CREATED#
DEPRECATED
Use created instead
Implementation
@Deprecated("Use created instead")
static const int CREATED = created;
created#
Implementation
static const int created = 201;
deprecated EXPECTATION_FAILED#
DEPRECATED
Use expectationFailed instead
Implementation
@Deprecated("Use expectationFailed instead")
static const int EXPECTATION_FAILED = expectationFailed;
expectationFailed#
Implementation
static const int expectationFailed = 417;
failedDependency#
Implementation
static const int failedDependency = 424;
deprecated FORBIDDEN#
DEPRECATED
Use forbidden instead
Implementation
@Deprecated("Use forbidden instead")
static const int FORBIDDEN = forbidden;
forbidden#
Implementation
static const int forbidden = 403;
deprecated FOUND#
DEPRECATED
Use found instead
Implementation
@Deprecated("Use found instead")
static const int FOUND = found;
found#
Implementation
static const int found = 302;
deprecated GATEWAY_TIMEOUT#
DEPRECATED
Use gatewayTimeout instead
Implementation
@Deprecated("Use gatewayTimeout instead")
static const int GATEWAY_TIMEOUT = gatewayTimeout;
gatewayTimeout#
Implementation
static const int gatewayTimeout = 504;
deprecated GONE#
DEPRECATED
Use gone instead
Implementation
@Deprecated("Use gone instead")
static const int GONE = gone;
gone#
Implementation
static const int gone = 410;
deprecated HTTP_VERSION_NOT_SUPPORTED#
DEPRECATED
Use httpVersionNotSupported instead
Implementation
@Deprecated("Use httpVersionNotSupported instead")
static const int HTTP_VERSION_NOT_SUPPORTED = httpVersionNotSupported;
httpVersionNotSupported#
Implementation
static const int httpVersionNotSupported = 505;
imUsed#
Implementation
static const int imUsed = 226;
insufficientStorage#
Implementation
static const int insufficientStorage = 507;
deprecated INTERNAL_SERVER_ERROR#
DEPRECATED
Use internalServerError instead
Implementation
@Deprecated("Use internalServerError instead")
static const int INTERNAL_SERVER_ERROR = internalServerError;
internalServerError#
Implementation
static const int internalServerError = 500;
deprecated LENGTH_REQUIRED#
DEPRECATED
Use lengthRequired instead
Implementation
@Deprecated("Use lengthRequired instead")
static const int LENGTH_REQUIRED = lengthRequired;
lengthRequired#
Implementation
static const int lengthRequired = 411;
locked#
Implementation
static const int locked = 423;
loopDetected#
Implementation
static const int loopDetected = 508;
deprecated METHOD_NOT_ALLOWED#
DEPRECATED
Use methodNotAllowed instead
Implementation
@Deprecated("Use methodNotAllowed instead")
static const int METHOD_NOT_ALLOWED = methodNotAllowed;
methodNotAllowed#
Implementation
static const int methodNotAllowed = 405;
misdirectedRequest#
Implementation
static const int misdirectedRequest = 421;
deprecated MOVED_PERMANENTLY#
DEPRECATED
Use movedPermanently instead
Implementation
@Deprecated("Use movedPermanently instead")
static const int MOVED_PERMANENTLY = movedPermanently;
deprecated MOVED_TEMPORARILY#
DEPRECATED
Use movedTemporarily instead
Implementation
@Deprecated("Use movedTemporarily instead")
static const int MOVED_TEMPORARILY = movedTemporarily;
movedPermanently#
Implementation
static const int movedPermanently = 301;
movedTemporarily#
Implementation
static const int movedTemporarily = 302;
deprecated MULTIPLE_CHOICES#
DEPRECATED
Use multipleChoices instead
Implementation
@Deprecated("Use multipleChoices instead")
static const int MULTIPLE_CHOICES = multipleChoices;
multipleChoices#
Implementation
static const int multipleChoices = 300;
multiStatus#
Implementation
static const int multiStatus = 207;
deprecated NETWORK_CONNECT_TIMEOUT_ERROR#
DEPRECATED
Use networkConnectTimeoutError instead
Implementation
@Deprecated("Use networkConnectTimeoutError instead")
static const int NETWORK_CONNECT_TIMEOUT_ERROR = networkConnectTimeoutError;
networkAuthenticationRequired#
Implementation
static const int networkAuthenticationRequired = 511;
networkConnectTimeoutError#
Implementation
static const int networkConnectTimeoutError = 599;
deprecated NO_CONTENT#
DEPRECATED
Use noContent instead
Implementation
@Deprecated("Use noContent instead")
static const int NO_CONTENT = noContent;
noContent#
Implementation
static const int noContent = 204;
deprecated NON_AUTHORITATIVE_INFORMATION#
DEPRECATED
Use nonAuthoritativeInformation instead
Implementation
@Deprecated("Use nonAuthoritativeInformation instead")
static const int NON_AUTHORITATIVE_INFORMATION = nonAuthoritativeInformation;
nonAuthoritativeInformation#
Implementation
static const int nonAuthoritativeInformation = 203;
deprecated NOT_ACCEPTABLE#
DEPRECATED
Use notAcceptable instead
Implementation
@Deprecated("Use notAcceptable instead")
static const int NOT_ACCEPTABLE = notAcceptable;
deprecated NOT_FOUND#
DEPRECATED
Use notFound instead
Implementation
@Deprecated("Use notFound instead")
static const int NOT_FOUND = notFound;
deprecated NOT_IMPLEMENTED#
DEPRECATED
Use notImplemented instead
Implementation
@Deprecated("Use notImplemented instead")
static const int NOT_IMPLEMENTED = notImplemented;
deprecated NOT_MODIFIED#
DEPRECATED
Use notModified instead
Implementation
@Deprecated("Use notModified instead")
static const int NOT_MODIFIED = notModified;
notAcceptable#
Implementation
static const int notAcceptable = 406;
notExtended#
Implementation
static const int notExtended = 510;
notFound#
Implementation
static const int notFound = 404;
notImplemented#
Implementation
static const int notImplemented = 501;
notModified#
Implementation
static const int notModified = 304;
deprecated OK#
DEPRECATED
Use ok instead
Implementation
@Deprecated("Use ok instead")
static const int OK = ok;
ok#
Implementation
static const int ok = 200;
deprecated PARTIAL_CONTENT#
DEPRECATED
Use partialContent instead
Implementation
@Deprecated("Use partialContent instead")
static const int PARTIAL_CONTENT = partialContent;
partialContent#
Implementation
static const int partialContent = 206;
deprecated PAYMENT_REQUIRED#
DEPRECATED
Use paymentRequired instead
Implementation
@Deprecated("Use paymentRequired instead")
static const int PAYMENT_REQUIRED = paymentRequired;
paymentRequired#
Implementation
static const int paymentRequired = 402;
permanentRedirect#
Implementation
static const int permanentRedirect = 308;
deprecated PRECONDITION_FAILED#
DEPRECATED
Use preconditionFailed instead
Implementation
@Deprecated("Use preconditionFailed instead")
static const int PRECONDITION_FAILED = preconditionFailed;
preconditionFailed#
Implementation
static const int preconditionFailed = 412;
preconditionRequired#
Implementation
static const int preconditionRequired = 428;
processing#
Implementation
static const int processing = 102;
deprecated PROXY_AUTHENTICATION_REQUIRED#
DEPRECATED
Use proxyAuthenticationRequired instead
Implementation
@Deprecated("Use proxyAuthenticationRequired instead")
static const int PROXY_AUTHENTICATION_REQUIRED = proxyAuthenticationRequired;
proxyAuthenticationRequired#
Implementation
static const int proxyAuthenticationRequired = 407;
deprecated REQUEST_ENTITY_TOO_LARGE#
DEPRECATED
Use requestEntityTooLarge instead
Implementation
@Deprecated("Use requestEntityTooLarge instead")
static const int REQUEST_ENTITY_TOO_LARGE = requestEntityTooLarge;
deprecated REQUEST_TIMEOUT#
DEPRECATED
Use requestTimeout instead
Implementation
@Deprecated("Use requestTimeout instead")
static const int REQUEST_TIMEOUT = requestTimeout;
deprecated REQUEST_URI_TOO_LONG#
DEPRECATED
Use requestUriTooLong instead
Implementation
@Deprecated("Use requestUriTooLong instead")
static const int REQUEST_URI_TOO_LONG = requestUriTooLong;
deprecated REQUESTED_RANGE_NOT_SATISFIABLE#
DEPRECATED
Use requestedRangeNotSatisfiable instead
Implementation
@Deprecated("Use requestedRangeNotSatisfiable instead")
static const int REQUESTED_RANGE_NOT_SATISFIABLE =
requestedRangeNotSatisfiable;
requestedRangeNotSatisfiable#
Implementation
static const int requestedRangeNotSatisfiable = 416;
requestEntityTooLarge#
Implementation
static const int requestEntityTooLarge = 413;
requestHeaderFieldsTooLarge#
Implementation
static const int requestHeaderFieldsTooLarge = 431;
requestTimeout#
Implementation
static const int requestTimeout = 408;
requestUriTooLong#
Implementation
static const int requestUriTooLong = 414;
deprecated RESET_CONTENT#
DEPRECATED
Use resetContent instead
Implementation
@Deprecated("Use resetContent instead")
static const int RESET_CONTENT = resetContent;
resetContent#
Implementation
static const int resetContent = 205;
deprecated SEE_OTHER#
DEPRECATED
Use seeOther instead
Implementation
@Deprecated("Use seeOther instead")
static const int SEE_OTHER = seeOther;
seeOther#
Implementation
static const int seeOther = 303;
deprecated SERVICE_UNAVAILABLE#
DEPRECATED
Use serviceUnavailable instead
Implementation
@Deprecated("Use serviceUnavailable instead")
static const int SERVICE_UNAVAILABLE = serviceUnavailable;
serviceUnavailable#
Implementation
static const int serviceUnavailable = 503;
deprecated SWITCHING_PROTOCOLS#
DEPRECATED
Use switchingProtocols instead
Implementation
@Deprecated("Use switchingProtocols instead")
static const int SWITCHING_PROTOCOLS = switchingProtocols;
switchingProtocols#
Implementation
static const int switchingProtocols = 101;
deprecated TEMPORARY_REDIRECT#
DEPRECATED
Use temporaryRedirect instead
Implementation
@Deprecated("Use temporaryRedirect instead")
static const int TEMPORARY_REDIRECT = temporaryRedirect;
temporaryRedirect#
Implementation
static const int temporaryRedirect = 307;
tooManyRequests#
Implementation
static const int tooManyRequests = 429;
deprecated UNAUTHORIZED#
DEPRECATED
Use unauthorized instead
Implementation
@Deprecated("Use unauthorized instead")
static const int UNAUTHORIZED = unauthorized;
unauthorized#
Implementation
static const int unauthorized = 401;
unavailableForLegalReasons#
Implementation
static const int unavailableForLegalReasons = 451;
unprocessableEntity#
Implementation
static const int unprocessableEntity = 422;
deprecated UNSUPPORTED_MEDIA_TYPE#
DEPRECATED
Use unsupportedMediaType instead
Implementation
@Deprecated("Use unsupportedMediaType instead")
static const int UNSUPPORTED_MEDIA_TYPE = unsupportedMediaType;
unsupportedMediaType#
Implementation
static const int unsupportedMediaType = 415;
deprecated UPGRADE_REQUIRED#
DEPRECATED
Use upgradeRequired instead
Implementation
@Deprecated("Use upgradeRequired instead")
static const int UPGRADE_REQUIRED = upgradeRequired;
upgradeRequired#
Implementation
static const int upgradeRequired = 426;
deprecated USE_PROXY#
DEPRECATED
Use useProxy instead
Implementation
@Deprecated("Use useProxy instead")
static const int USE_PROXY = useProxy;
useProxy#
Implementation
static const int useProxy = 305;
variantAlsoNegotiates#
Implementation
static const int variantAlsoNegotiates = 506;