Skip to content

HttpStatus abstract ​

abstract class HttpStatus

HTTP status codes. Exported in dart:io and dart:html.

Constructors ​

HttpStatus() ​

HttpStatus()

Properties ​

hashCode no setter inherited ​

int get hashCode

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
dart
external int get hashCode;

runtimeType no setter inherited ​

Type get runtimeType

A representation of the runtime type of the object.

Inherited from Object.

Implementation
dart
external Type get runtimeType;

Methods ​

noSuchMethod() inherited ​

dynamic noSuchMethod(Invocation invocation)

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:

dart
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:

dart
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
dart
@pragma("vm:entry-point")
@pragma("wasm:entry-point")
external dynamic noSuchMethod(Invocation invocation);

toString() inherited ​

String toString()

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
dart
external String toString();

Operators ​

operator ==() inherited ​

bool operator ==(Object other)

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 == o must be true.

  • Symmetric: For all objects o1 and o2, o1 == o2 and o2 == o1 must either both be true, or both be false.

  • Transitive: For all objects o1, o2, and o3, if o1 == o2 and o2 == o3 are true, then o1 == o3 must 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
dart
external bool operator ==(Object other);

Constants ​

deprecated ACCEPTED ​

const int ACCEPTED

DEPRECATED

Use accepted instead

Implementation
dart
@Deprecated("Use accepted instead")
static const int ACCEPTED = accepted;

accepted ​

const int accepted
Implementation
dart
static const int accepted = 202;

alreadyReported ​

const int alreadyReported
Implementation
dart
static const int alreadyReported = 208;

deprecated BAD_GATEWAY ​

const int BAD_GATEWAY

DEPRECATED

Use badGateway instead

Implementation
dart
@Deprecated("Use badGateway instead")
static const int BAD_GATEWAY = badGateway;

deprecated BAD_REQUEST ​

const int BAD_REQUEST

DEPRECATED

Use badRequest instead

Implementation
dart
@Deprecated("Use badRequest instead")
static const int BAD_REQUEST = badRequest;

badGateway ​

const int badGateway
Implementation
dart
static const int badGateway = 502;

badRequest ​

const int badRequest
Implementation
dart
static const int badRequest = 400;

clientClosedRequest ​

const int clientClosedRequest
Implementation
dart
static const int clientClosedRequest = 499;

deprecated CONFLICT ​

const int CONFLICT

DEPRECATED

Use conflict instead

Implementation
dart
@Deprecated("Use conflict instead")
static const int CONFLICT = conflict;

conflict ​

const int conflict
Implementation
dart
static const int conflict = 409;

connectionClosedWithoutResponse ​

const int connectionClosedWithoutResponse
Implementation
dart
static const int connectionClosedWithoutResponse = 444;

deprecated CONTINUE ​

const int CONTINUE

DEPRECATED

Use continue_ instead

Implementation
dart
@Deprecated("Use continue_ instead")
static const int CONTINUE = continue_;

continue_ ​

const int continue_
Implementation
dart
static const int continue_ = 100;

deprecated CREATED ​

const int CREATED

DEPRECATED

Use created instead

Implementation
dart
@Deprecated("Use created instead")
static const int CREATED = created;

created ​

const int created
Implementation
dart
static const int created = 201;

deprecated EXPECTATION_FAILED ​

const int EXPECTATION_FAILED

DEPRECATED

Use expectationFailed instead

Implementation
dart
@Deprecated("Use expectationFailed instead")
static const int EXPECTATION_FAILED = expectationFailed;

expectationFailed ​

const int expectationFailed
Implementation
dart
static const int expectationFailed = 417;

failedDependency ​

const int failedDependency
Implementation
dart
static const int failedDependency = 424;

deprecated FORBIDDEN ​

const int FORBIDDEN

DEPRECATED

Use forbidden instead

Implementation
dart
@Deprecated("Use forbidden instead")
static const int FORBIDDEN = forbidden;

forbidden ​

const int forbidden
Implementation
dart
static const int forbidden = 403;

deprecated FOUND ​

const int FOUND

DEPRECATED

Use found instead

Implementation
dart
@Deprecated("Use found instead")
static const int FOUND = found;

found ​

const int found
Implementation
dart
static const int found = 302;

deprecated GATEWAY_TIMEOUT ​

const int GATEWAY_TIMEOUT

DEPRECATED

Use gatewayTimeout instead

Implementation
dart
@Deprecated("Use gatewayTimeout instead")
static const int GATEWAY_TIMEOUT = gatewayTimeout;

gatewayTimeout ​

const int gatewayTimeout
Implementation
dart
static const int gatewayTimeout = 504;

deprecated GONE ​

const int GONE

DEPRECATED

Use gone instead

Implementation
dart
@Deprecated("Use gone instead")
static const int GONE = gone;

gone ​

const int gone
Implementation
dart
static const int gone = 410;

deprecated HTTP_VERSION_NOT_SUPPORTED ​

const int HTTP_VERSION_NOT_SUPPORTED

DEPRECATED

Use httpVersionNotSupported instead

Implementation
dart
@Deprecated("Use httpVersionNotSupported instead")
static const int HTTP_VERSION_NOT_SUPPORTED = httpVersionNotSupported;

httpVersionNotSupported ​

const int httpVersionNotSupported
Implementation
dart
static const int httpVersionNotSupported = 505;

imUsed ​

const int imUsed
Implementation
dart
static const int imUsed = 226;

insufficientStorage ​

const int insufficientStorage
Implementation
dart
static const int insufficientStorage = 507;

deprecated INTERNAL_SERVER_ERROR ​

const int INTERNAL_SERVER_ERROR

DEPRECATED

Use internalServerError instead

Implementation
dart
@Deprecated("Use internalServerError instead")
static const int INTERNAL_SERVER_ERROR = internalServerError;

internalServerError ​

const int internalServerError
Implementation
dart
static const int internalServerError = 500;

deprecated LENGTH_REQUIRED ​

const int LENGTH_REQUIRED

DEPRECATED

Use lengthRequired instead

Implementation
dart
@Deprecated("Use lengthRequired instead")
static const int LENGTH_REQUIRED = lengthRequired;

lengthRequired ​

const int lengthRequired
Implementation
dart
static const int lengthRequired = 411;

locked ​

const int locked
Implementation
dart
static const int locked = 423;

loopDetected ​

const int loopDetected
Implementation
dart
static const int loopDetected = 508;

deprecated METHOD_NOT_ALLOWED ​

const int METHOD_NOT_ALLOWED

DEPRECATED

Use methodNotAllowed instead

Implementation
dart
@Deprecated("Use methodNotAllowed instead")
static const int METHOD_NOT_ALLOWED = methodNotAllowed;

methodNotAllowed ​

const int methodNotAllowed
Implementation
dart
static const int methodNotAllowed = 405;

misdirectedRequest ​

const int misdirectedRequest
Implementation
dart
static const int misdirectedRequest = 421;

deprecated MOVED_PERMANENTLY ​

const int MOVED_PERMANENTLY

DEPRECATED

Use movedPermanently instead

Implementation
dart
@Deprecated("Use movedPermanently instead")
static const int MOVED_PERMANENTLY = movedPermanently;

deprecated MOVED_TEMPORARILY ​

const int MOVED_TEMPORARILY

DEPRECATED

Use movedTemporarily instead

Implementation
dart
@Deprecated("Use movedTemporarily instead")
static const int MOVED_TEMPORARILY = movedTemporarily;

movedPermanently ​

const int movedPermanently
Implementation
dart
static const int movedPermanently = 301;

movedTemporarily ​

const int movedTemporarily
Implementation
dart
static const int movedTemporarily = 302;

deprecated MULTIPLE_CHOICES ​

const int MULTIPLE_CHOICES

DEPRECATED

Use multipleChoices instead

Implementation
dart
@Deprecated("Use multipleChoices instead")
static const int MULTIPLE_CHOICES = multipleChoices;

multipleChoices ​

const int multipleChoices
Implementation
dart
static const int multipleChoices = 300;

multiStatus ​

const int multiStatus
Implementation
dart
static const int multiStatus = 207;

deprecated NETWORK_CONNECT_TIMEOUT_ERROR ​

const int NETWORK_CONNECT_TIMEOUT_ERROR

DEPRECATED

Use networkConnectTimeoutError instead

Implementation
dart
@Deprecated("Use networkConnectTimeoutError instead")
static const int NETWORK_CONNECT_TIMEOUT_ERROR = networkConnectTimeoutError;

networkAuthenticationRequired ​

const int networkAuthenticationRequired
Implementation
dart
static const int networkAuthenticationRequired = 511;

networkConnectTimeoutError ​

const int networkConnectTimeoutError
Implementation
dart
static const int networkConnectTimeoutError = 599;

deprecated NO_CONTENT ​

const int NO_CONTENT

DEPRECATED

Use noContent instead

Implementation
dart
@Deprecated("Use noContent instead")
static const int NO_CONTENT = noContent;

noContent ​

const int noContent
Implementation
dart
static const int noContent = 204;

deprecated NON_AUTHORITATIVE_INFORMATION ​

const int NON_AUTHORITATIVE_INFORMATION

DEPRECATED

Use nonAuthoritativeInformation instead

Implementation
dart
@Deprecated("Use nonAuthoritativeInformation instead")
static const int NON_AUTHORITATIVE_INFORMATION = nonAuthoritativeInformation;

nonAuthoritativeInformation ​

const int nonAuthoritativeInformation
Implementation
dart
static const int nonAuthoritativeInformation = 203;

deprecated NOT_ACCEPTABLE ​

const int NOT_ACCEPTABLE

DEPRECATED

Use notAcceptable instead

Implementation
dart
@Deprecated("Use notAcceptable instead")
static const int NOT_ACCEPTABLE = notAcceptable;

deprecated NOT_FOUND ​

const int NOT_FOUND

DEPRECATED

Use notFound instead

Implementation
dart
@Deprecated("Use notFound instead")
static const int NOT_FOUND = notFound;

deprecated NOT_IMPLEMENTED ​

const int NOT_IMPLEMENTED

DEPRECATED

Use notImplemented instead

Implementation
dart
@Deprecated("Use notImplemented instead")
static const int NOT_IMPLEMENTED = notImplemented;

deprecated NOT_MODIFIED ​

const int NOT_MODIFIED

DEPRECATED

Use notModified instead

Implementation
dart
@Deprecated("Use notModified instead")
static const int NOT_MODIFIED = notModified;

notAcceptable ​

const int notAcceptable
Implementation
dart
static const int notAcceptable = 406;

notExtended ​

const int notExtended
Implementation
dart
static const int notExtended = 510;

notFound ​

const int notFound
Implementation
dart
static const int notFound = 404;

notImplemented ​

const int notImplemented
Implementation
dart
static const int notImplemented = 501;

notModified ​

const int notModified
Implementation
dart
static const int notModified = 304;

deprecated OK ​

const int OK

DEPRECATED

Use ok instead

Implementation
dart
@Deprecated("Use ok instead")
static const int OK = ok;

ok ​

const int ok
Implementation
dart
static const int ok = 200;

deprecated PARTIAL_CONTENT ​

const int PARTIAL_CONTENT

DEPRECATED

Use partialContent instead

Implementation
dart
@Deprecated("Use partialContent instead")
static const int PARTIAL_CONTENT = partialContent;

partialContent ​

const int partialContent
Implementation
dart
static const int partialContent = 206;

deprecated PAYMENT_REQUIRED ​

const int PAYMENT_REQUIRED

DEPRECATED

Use paymentRequired instead

Implementation
dart
@Deprecated("Use paymentRequired instead")
static const int PAYMENT_REQUIRED = paymentRequired;

paymentRequired ​

const int paymentRequired
Implementation
dart
static const int paymentRequired = 402;

permanentRedirect ​

const int permanentRedirect
Implementation
dart
static const int permanentRedirect = 308;

deprecated PRECONDITION_FAILED ​

const int PRECONDITION_FAILED

DEPRECATED

Use preconditionFailed instead

Implementation
dart
@Deprecated("Use preconditionFailed instead")
static const int PRECONDITION_FAILED = preconditionFailed;

preconditionFailed ​

const int preconditionFailed
Implementation
dart
static const int preconditionFailed = 412;

preconditionRequired ​

const int preconditionRequired
Implementation
dart
static const int preconditionRequired = 428;

processing ​

const int processing
Implementation
dart
static const int processing = 102;

deprecated PROXY_AUTHENTICATION_REQUIRED ​

const int PROXY_AUTHENTICATION_REQUIRED

DEPRECATED

Use proxyAuthenticationRequired instead

Implementation
dart
@Deprecated("Use proxyAuthenticationRequired instead")
static const int PROXY_AUTHENTICATION_REQUIRED = proxyAuthenticationRequired;

proxyAuthenticationRequired ​

const int proxyAuthenticationRequired
Implementation
dart
static const int proxyAuthenticationRequired = 407;

deprecated REQUEST_ENTITY_TOO_LARGE ​

const int REQUEST_ENTITY_TOO_LARGE

DEPRECATED

Use requestEntityTooLarge instead

Implementation
dart
@Deprecated("Use requestEntityTooLarge instead")
static const int REQUEST_ENTITY_TOO_LARGE = requestEntityTooLarge;

deprecated REQUEST_TIMEOUT ​

const int REQUEST_TIMEOUT

DEPRECATED

Use requestTimeout instead

Implementation
dart
@Deprecated("Use requestTimeout instead")
static const int REQUEST_TIMEOUT = requestTimeout;

deprecated REQUEST_URI_TOO_LONG ​

const int REQUEST_URI_TOO_LONG

DEPRECATED

Use requestUriTooLong instead

Implementation
dart
@Deprecated("Use requestUriTooLong instead")
static const int REQUEST_URI_TOO_LONG = requestUriTooLong;

deprecated REQUESTED_RANGE_NOT_SATISFIABLE ​

const int REQUESTED_RANGE_NOT_SATISFIABLE

DEPRECATED

Use requestedRangeNotSatisfiable instead

Implementation
dart
@Deprecated("Use requestedRangeNotSatisfiable instead")
static const int REQUESTED_RANGE_NOT_SATISFIABLE =
    requestedRangeNotSatisfiable;

requestedRangeNotSatisfiable ​

const int requestedRangeNotSatisfiable
Implementation
dart
static const int requestedRangeNotSatisfiable = 416;

requestEntityTooLarge ​

const int requestEntityTooLarge
Implementation
dart
static const int requestEntityTooLarge = 413;

requestHeaderFieldsTooLarge ​

const int requestHeaderFieldsTooLarge
Implementation
dart
static const int requestHeaderFieldsTooLarge = 431;

requestTimeout ​

const int requestTimeout
Implementation
dart
static const int requestTimeout = 408;

requestUriTooLong ​

const int requestUriTooLong
Implementation
dart
static const int requestUriTooLong = 414;

deprecated RESET_CONTENT ​

const int RESET_CONTENT

DEPRECATED

Use resetContent instead

Implementation
dart
@Deprecated("Use resetContent instead")
static const int RESET_CONTENT = resetContent;

resetContent ​

const int resetContent
Implementation
dart
static const int resetContent = 205;

deprecated SEE_OTHER ​

const int SEE_OTHER

DEPRECATED

Use seeOther instead

Implementation
dart
@Deprecated("Use seeOther instead")
static const int SEE_OTHER = seeOther;

seeOther ​

const int seeOther
Implementation
dart
static const int seeOther = 303;

deprecated SERVICE_UNAVAILABLE ​

const int SERVICE_UNAVAILABLE

DEPRECATED

Use serviceUnavailable instead

Implementation
dart
@Deprecated("Use serviceUnavailable instead")
static const int SERVICE_UNAVAILABLE = serviceUnavailable;

serviceUnavailable ​

const int serviceUnavailable
Implementation
dart
static const int serviceUnavailable = 503;

deprecated SWITCHING_PROTOCOLS ​

const int SWITCHING_PROTOCOLS

DEPRECATED

Use switchingProtocols instead

Implementation
dart
@Deprecated("Use switchingProtocols instead")
static const int SWITCHING_PROTOCOLS = switchingProtocols;

switchingProtocols ​

const int switchingProtocols
Implementation
dart
static const int switchingProtocols = 101;

deprecated TEMPORARY_REDIRECT ​

const int TEMPORARY_REDIRECT

DEPRECATED

Use temporaryRedirect instead

Implementation
dart
@Deprecated("Use temporaryRedirect instead")
static const int TEMPORARY_REDIRECT = temporaryRedirect;

temporaryRedirect ​

const int temporaryRedirect
Implementation
dart
static const int temporaryRedirect = 307;

tooManyRequests ​

const int tooManyRequests
Implementation
dart
static const int tooManyRequests = 429;

deprecated UNAUTHORIZED ​

const int UNAUTHORIZED

DEPRECATED

Use unauthorized instead

Implementation
dart
@Deprecated("Use unauthorized instead")
static const int UNAUTHORIZED = unauthorized;

unauthorized ​

const int unauthorized
Implementation
dart
static const int unauthorized = 401;

unavailableForLegalReasons ​

const int unavailableForLegalReasons
Implementation
dart
static const int unavailableForLegalReasons = 451;

unprocessableEntity ​

const int unprocessableEntity
Implementation
dart
static const int unprocessableEntity = 422;

deprecated UNSUPPORTED_MEDIA_TYPE ​

const int UNSUPPORTED_MEDIA_TYPE

DEPRECATED

Use unsupportedMediaType instead

Implementation
dart
@Deprecated("Use unsupportedMediaType instead")
static const int UNSUPPORTED_MEDIA_TYPE = unsupportedMediaType;

unsupportedMediaType ​

const int unsupportedMediaType
Implementation
dart
static const int unsupportedMediaType = 415;

deprecated UPGRADE_REQUIRED ​

const int UPGRADE_REQUIRED

DEPRECATED

Use upgradeRequired instead

Implementation
dart
@Deprecated("Use upgradeRequired instead")
static const int UPGRADE_REQUIRED = upgradeRequired;

upgradeRequired ​

const int upgradeRequired
Implementation
dart
static const int upgradeRequired = 426;

deprecated USE_PROXY ​

const int USE_PROXY

DEPRECATED

Use useProxy instead

Implementation
dart
@Deprecated("Use useProxy instead")
static const int USE_PROXY = useProxy;

useProxy ​

const int useProxy
Implementation
dart
static const int useProxy = 305;

variantAlsoNegotiates ​

const int variantAlsoNegotiates
Implementation
dart
static const int variantAlsoNegotiates = 506;