HttpStatus
LogoDart

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

runtimeType no setter inherited#

Type get runtimeType

A representation of the runtime type of the object.

Inherited from Object.

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

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#

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
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
external bool operator ==(Object other);

Constants#

deprecated ACCEPTED#

const int ACCEPTED

DEPRECATED

Use accepted instead

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

accepted#

const int accepted
Implementation
static const int accepted = 202;

alreadyReported#

const int alreadyReported
Implementation
static const int alreadyReported = 208;

deprecated BAD_GATEWAY#

const int BAD_GATEWAY

DEPRECATED

Use badGateway instead

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

deprecated BAD_REQUEST#

const int BAD_REQUEST

DEPRECATED

Use badRequest instead

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

badGateway#

const int badGateway
Implementation
static const int badGateway = 502;

badRequest#

const int badRequest
Implementation
static const int badRequest = 400;

clientClosedRequest#

const int clientClosedRequest
Implementation
static const int clientClosedRequest = 499;

deprecated CONFLICT#

const int CONFLICT

DEPRECATED

Use conflict instead

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

conflict#

const int conflict
Implementation
static const int conflict = 409;

connectionClosedWithoutResponse#

const int connectionClosedWithoutResponse
Implementation
static const int connectionClosedWithoutResponse = 444;

deprecated CONTINUE#

const int CONTINUE

DEPRECATED

Use continue_ instead

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

continue_#

const int continue_
Implementation
static const int continue_ = 100;

deprecated CREATED#

const int CREATED

DEPRECATED

Use created instead

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

created#

const int created
Implementation
static const int created = 201;

deprecated EXPECTATION_FAILED#

const int EXPECTATION_FAILED

DEPRECATED

Use expectationFailed instead

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

expectationFailed#

const int expectationFailed
Implementation
static const int expectationFailed = 417;

failedDependency#

const int failedDependency
Implementation
static const int failedDependency = 424;

deprecated FORBIDDEN#

const int FORBIDDEN

DEPRECATED

Use forbidden instead

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

forbidden#

const int forbidden
Implementation
static const int forbidden = 403;

deprecated FOUND#

const int FOUND

DEPRECATED

Use found instead

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

found#

const int found
Implementation
static const int found = 302;

deprecated GATEWAY_TIMEOUT#

const int GATEWAY_TIMEOUT

DEPRECATED

Use gatewayTimeout instead

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

gatewayTimeout#

const int gatewayTimeout
Implementation
static const int gatewayTimeout = 504;

deprecated GONE#

const int GONE

DEPRECATED

Use gone instead

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

gone#

const int gone
Implementation
static const int gone = 410;

deprecated HTTP_VERSION_NOT_SUPPORTED#

const int HTTP_VERSION_NOT_SUPPORTED

DEPRECATED

Use httpVersionNotSupported instead

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

httpVersionNotSupported#

const int httpVersionNotSupported
Implementation
static const int httpVersionNotSupported = 505;

imUsed#

const int imUsed
Implementation
static const int imUsed = 226;

insufficientStorage#

const int insufficientStorage
Implementation
static const int insufficientStorage = 507;

deprecated INTERNAL_SERVER_ERROR#

const int INTERNAL_SERVER_ERROR

DEPRECATED

Use internalServerError instead

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

internalServerError#

const int internalServerError
Implementation
static const int internalServerError = 500;

deprecated LENGTH_REQUIRED#

const int LENGTH_REQUIRED

DEPRECATED

Use lengthRequired instead

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

lengthRequired#

const int lengthRequired
Implementation
static const int lengthRequired = 411;

locked#

const int locked
Implementation
static const int locked = 423;

loopDetected#

const int loopDetected
Implementation
static const int loopDetected = 508;

deprecated METHOD_NOT_ALLOWED#

const int METHOD_NOT_ALLOWED

DEPRECATED

Use methodNotAllowed instead

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

methodNotAllowed#

const int methodNotAllowed
Implementation
static const int methodNotAllowed = 405;

misdirectedRequest#

const int misdirectedRequest
Implementation
static const int misdirectedRequest = 421;

deprecated MOVED_PERMANENTLY#

const int MOVED_PERMANENTLY

DEPRECATED

Use movedPermanently instead

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

deprecated MOVED_TEMPORARILY#

const int MOVED_TEMPORARILY

DEPRECATED

Use movedTemporarily instead

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

movedPermanently#

const int movedPermanently
Implementation
static const int movedPermanently = 301;

movedTemporarily#

const int movedTemporarily
Implementation
static const int movedTemporarily = 302;

deprecated MULTIPLE_CHOICES#

const int MULTIPLE_CHOICES

DEPRECATED

Use multipleChoices instead

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

multipleChoices#

const int multipleChoices
Implementation
static const int multipleChoices = 300;

multiStatus#

const int multiStatus
Implementation
static const int multiStatus = 207;

deprecated NETWORK_CONNECT_TIMEOUT_ERROR#

const int NETWORK_CONNECT_TIMEOUT_ERROR

DEPRECATED

Use networkConnectTimeoutError instead

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

networkAuthenticationRequired#

const int networkAuthenticationRequired
Implementation
static const int networkAuthenticationRequired = 511;

networkConnectTimeoutError#

const int networkConnectTimeoutError
Implementation
static const int networkConnectTimeoutError = 599;

deprecated NO_CONTENT#

const int NO_CONTENT

DEPRECATED

Use noContent instead

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

noContent#

const int noContent
Implementation
static const int noContent = 204;

deprecated NON_AUTHORITATIVE_INFORMATION#

const int NON_AUTHORITATIVE_INFORMATION

DEPRECATED

Use nonAuthoritativeInformation instead

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

nonAuthoritativeInformation#

const int nonAuthoritativeInformation
Implementation
static const int nonAuthoritativeInformation = 203;

deprecated NOT_ACCEPTABLE#

const int NOT_ACCEPTABLE

DEPRECATED

Use notAcceptable instead

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

deprecated NOT_FOUND#

const int NOT_FOUND

DEPRECATED

Use notFound instead

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

deprecated NOT_IMPLEMENTED#

const int NOT_IMPLEMENTED

DEPRECATED

Use notImplemented instead

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

deprecated NOT_MODIFIED#

const int NOT_MODIFIED

DEPRECATED

Use notModified instead

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

notAcceptable#

const int notAcceptable
Implementation
static const int notAcceptable = 406;

notExtended#

const int notExtended
Implementation
static const int notExtended = 510;

notFound#

const int notFound
Implementation
static const int notFound = 404;

notImplemented#

const int notImplemented
Implementation
static const int notImplemented = 501;

notModified#

const int notModified
Implementation
static const int notModified = 304;

deprecated OK#

const int OK

DEPRECATED

Use ok instead

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

ok#

const int ok
Implementation
static const int ok = 200;

deprecated PARTIAL_CONTENT#

const int PARTIAL_CONTENT

DEPRECATED

Use partialContent instead

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

partialContent#

const int partialContent
Implementation
static const int partialContent = 206;

deprecated PAYMENT_REQUIRED#

const int PAYMENT_REQUIRED

DEPRECATED

Use paymentRequired instead

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

paymentRequired#

const int paymentRequired
Implementation
static const int paymentRequired = 402;

permanentRedirect#

const int permanentRedirect
Implementation
static const int permanentRedirect = 308;

deprecated PRECONDITION_FAILED#

const int PRECONDITION_FAILED

DEPRECATED

Use preconditionFailed instead

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

preconditionFailed#

const int preconditionFailed
Implementation
static const int preconditionFailed = 412;

preconditionRequired#

const int preconditionRequired
Implementation
static const int preconditionRequired = 428;

processing#

const int processing
Implementation
static const int processing = 102;

deprecated PROXY_AUTHENTICATION_REQUIRED#

const int PROXY_AUTHENTICATION_REQUIRED

DEPRECATED

Use proxyAuthenticationRequired instead

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

proxyAuthenticationRequired#

const int proxyAuthenticationRequired
Implementation
static const int proxyAuthenticationRequired = 407;

deprecated REQUEST_ENTITY_TOO_LARGE#

const int REQUEST_ENTITY_TOO_LARGE

DEPRECATED

Use requestEntityTooLarge instead

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

deprecated REQUEST_TIMEOUT#

const int REQUEST_TIMEOUT

DEPRECATED

Use requestTimeout instead

Implementation
@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
@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
@Deprecated("Use requestedRangeNotSatisfiable instead")
static const int REQUESTED_RANGE_NOT_SATISFIABLE =
    requestedRangeNotSatisfiable;

requestedRangeNotSatisfiable#

const int requestedRangeNotSatisfiable
Implementation
static const int requestedRangeNotSatisfiable = 416;

requestEntityTooLarge#

const int requestEntityTooLarge
Implementation
static const int requestEntityTooLarge = 413;

requestHeaderFieldsTooLarge#

const int requestHeaderFieldsTooLarge
Implementation
static const int requestHeaderFieldsTooLarge = 431;

requestTimeout#

const int requestTimeout
Implementation
static const int requestTimeout = 408;

requestUriTooLong#

const int requestUriTooLong
Implementation
static const int requestUriTooLong = 414;

deprecated RESET_CONTENT#

const int RESET_CONTENT

DEPRECATED

Use resetContent instead

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

resetContent#

const int resetContent
Implementation
static const int resetContent = 205;

deprecated SEE_OTHER#

const int SEE_OTHER

DEPRECATED

Use seeOther instead

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

seeOther#

const int seeOther
Implementation
static const int seeOther = 303;

deprecated SERVICE_UNAVAILABLE#

const int SERVICE_UNAVAILABLE

DEPRECATED

Use serviceUnavailable instead

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

serviceUnavailable#

const int serviceUnavailable
Implementation
static const int serviceUnavailable = 503;

deprecated SWITCHING_PROTOCOLS#

const int SWITCHING_PROTOCOLS

DEPRECATED

Use switchingProtocols instead

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

switchingProtocols#

const int switchingProtocols
Implementation
static const int switchingProtocols = 101;

deprecated TEMPORARY_REDIRECT#

const int TEMPORARY_REDIRECT

DEPRECATED

Use temporaryRedirect instead

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

temporaryRedirect#

const int temporaryRedirect
Implementation
static const int temporaryRedirect = 307;

tooManyRequests#

const int tooManyRequests
Implementation
static const int tooManyRequests = 429;

deprecated UNAUTHORIZED#

const int UNAUTHORIZED

DEPRECATED

Use unauthorized instead

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

unauthorized#

const int unauthorized
Implementation
static const int unauthorized = 401;

unavailableForLegalReasons#

const int unavailableForLegalReasons
Implementation
static const int unavailableForLegalReasons = 451;

unprocessableEntity#

const int unprocessableEntity
Implementation
static const int unprocessableEntity = 422;

deprecated UNSUPPORTED_MEDIA_TYPE#

const int UNSUPPORTED_MEDIA_TYPE

DEPRECATED

Use unsupportedMediaType instead

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

unsupportedMediaType#

const int unsupportedMediaType
Implementation
static const int unsupportedMediaType = 415;

deprecated UPGRADE_REQUIRED#

const int UPGRADE_REQUIRED

DEPRECATED

Use upgradeRequired instead

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

upgradeRequired#

const int upgradeRequired
Implementation
static const int upgradeRequired = 426;

deprecated USE_PROXY#

const int USE_PROXY

DEPRECATED

Use useProxy instead

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

useProxy#

const int useProxy
Implementation
static const int useProxy = 305;

variantAlsoNegotiates#

const int variantAlsoNegotiates
Implementation
static const int variantAlsoNegotiates = 506;