ResponseStatus class
Handles HTTP response status codes with convenient methods and constants.
This class provides a clean API for setting HTTP status codes with descriptive names and common status code constants.
Constructors
- ResponseStatus(HttpResponse _response)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isClientError → bool
-
Checks if the status code indicates client error (4xx).
no setter
- isRedirection → bool
-
Checks if the status code indicates redirection (3xx).
no setter
- isServerError → bool
-
Checks if the status code indicates server error (5xx).
no setter
- isSuccess → bool
-
Checks if the status code indicates success (2xx).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- statusCode → int
-
Gets the current status code.
no setter
Methods
-
accepted(
) → void - Sets status to 202 Accepted.
-
badGateway(
) → void - Sets status to 502 Bad Gateway.
-
badRequest(
) → void - Sets status to 400 Bad Request.
-
conflict(
) → void - Sets status to 409 Conflict.
-
created(
) → void - Sets status to 201 Created.
-
forbidden(
) → void - Sets status to 403 Forbidden.
-
found(
) → void - Sets status to 302 Found (temporary redirect).
-
gatewayTimeout(
) → void - Sets status to 504 Gateway Timeout.
-
getStatusMessage(
) → String - Gets a descriptive message for the current status code.
-
gone(
) → void - Sets status to 410 Gone.
-
internalServerError(
) → void - Sets status to 500 Internal Server Error.
-
methodNotAllowed(
) → void - Sets status to 405 Method Not Allowed.
-
movedPermanently(
) → void - Sets status to 301 Moved Permanently.
-
noContent(
) → void - Sets status to 204 No Content.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notFound(
) → void - Sets status to 404 Not Found.
-
notImplemented(
) → void - Sets status to 501 Not Implemented.
-
notModified(
) → void - Sets status to 304 Not Modified.
-
ok(
) → void - Sets status to 200 OK.
-
permanentRedirect(
) → void - Sets status to 308 Permanent Redirect.
-
seeOther(
) → void - Sets status to 303 See Other.
- Sets status to 503 Service Unavailable.
-
setStatus(
int code) → void - Sets the HTTP status code.
-
temporaryRedirect(
) → void - Sets status to 307 Temporary Redirect.
-
tooManyRequests(
) → void - Sets status to 429 Too Many Requests.
-
toString(
) → String -
A string representation of this object.
inherited
- Sets status to 401 Unauthorized.
-
unprocessableEntity(
) → void - Sets status to 422 Unprocessable Entity.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited