ResponseEntity class

Inheritance

Constructors

ResponseEntity(int statusCode, {Object? body, ObjectMapper? objectMapper, Map<String, Object>? headers, Encoding? encoding, Map<String, Object>? context})
ResponseEntity.badRequest({Object? body, Map<String, Object>? headers})
ResponseEntity.internalServerError({Object? body, Map<String, Object>? headers})
ResponseEntity.methodNotAllowed({Object? body, Map<String, Object>? headers})
ResponseEntity.notFound({Object? body, Map<String, Object>? headers})
ResponseEntity.ok({Object? body, Map<String, Object>? headers})
ResponseEntity.tooManyRequests({Object? body, int? retryAfter, Map<String, Object>? headers})

Properties

contentLength int?
The contents of the content-length field in headers.
no setterinherited
context Map<String, Object>
Extra context that can be used by for middleware and handlers.
finalinherited
encoding Encoding?
The encoding of the message body.
no setterinherited
expires DateTime?
The date and time after which the response's data should be considered stale.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
The HTTP headers with case-insensitive keys.
no setterinherited
headersAll Map<String, List<String>>
The HTTP headers with multiple values with case-insensitive keys.
no setterinherited
isEmpty bool
If true, the stream returned by read won't emit any bytes.
no setterinherited
lastModified DateTime?
The date and time the source of the response's data was last modified.
no setterinherited
mimeType String?
The MIME type of the message.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int
The HTTP status code of the response.
finalinherited

Methods

body<T>() → T
change({Map<String, Object?>? headers, Map<String, Object?>? context, Object? body}) Response
Creates a new Response by copying existing values and applying specified changes.
inherited
copyWith({int? statusCode, Object? body, Map<String, Object>? headers, Encoding? encoding, Map<String, Object>? context}) ResponseEntity
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read() Stream<List<int>>
Returns a Stream representing the body.
inherited
readAsString([Encoding? encoding]) Future<String>
Returns a Future containing the body as a String.
inherited
toString() String
A string representation of this object.
inherited

Operators

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