ResponseContext<RawResponse> class abstract

A convenience wrapper around an outgoing HTTP request.

Implemented types
Implementers

Constructors

ResponseContext()

Properties

app Angel?
The Angel instance that is sending a response.
getter/setter pair
buffer BytesBuilder?
A set of UTF-8 encoded bytes that will be written to the response.
no setter
chunked bool?
Is Transfer-Encoding chunked?
getter/setter pair
contentLength int?
Gets or sets the content length to send back to a client.
getter/setter pair
contentType ↔ MediaType
Gets or sets the content type to send back to a client.
getter/setter pair
cookies List<Cookie>
Any and all cookies to be sent to the user.
final
correspondingRequest RequestContext?
Points to the RequestContext corresponding to this response.
no setter
done Future
Return a future which is completed when the StreamSink is finished.
no setteroverride
encoders Map<String, Converter<List<int>, List<int>>>
A set of Converter objects that can be used to encode response data.
final
hashCode int
The hash code for this object.
no setterinherited
headers → CaseInsensitiveMap<String>
Headers that will be sent to the user.
no setter
isBuffered bool
Returns true if response data is being written to a buffer, rather than to the underlying stream.
no setter
isOpen bool
Returns true if the response is still available for processing by Angel.
no setter
properties Map
final
rawResponse → RawResponse
The underlying RawResponse under this instance.
no setter
renderParams Map<String, dynamic>
A Map of data to inject when res.render is called.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serializer FutureOr<String> Function(dynamic)
Serializes response data into a String.
getter/setter pair
statusCode int
This response's status code.
getter/setter pair

Methods

add(List<int> event) → void
Adds a data event to the sink.
inherited
addError(Object error, [StackTrace? stackTrace]) → void
Adds an error to the sink.
override
addStream(Stream<List<int>> stream) Future
Adds a stream directly the underlying response.
override
close() Future<void>
Prevents more data from being written to the response, and locks it entire from further editing.
override
detach() FutureOr<RawResponse>
Signals Angel that the response is being held alive deliberately, and that the framework should not automatically close it.
download(File file, {String? filename}) Future<void>
Sends a download as a response.
json(dynamic value) Future<bool>
Serializes JSON to the response.
jsonp(dynamic value, {String callbackName = 'callback', MediaType? contentType}) Future<void>
Returns a JSONP response.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
redirect(dynamic url, {bool absolute = true, int? code}) Future<void>
Redirects to user to the given URL.
redirectTo(String name, [Map? params, int? code]) Future<void>
Redirects to the given named Route.
redirectToAction(String action, [Map? params, int? code]) Future<void>
Redirects to the given Controller action.
render(String view, [Map<String, dynamic>? data]) Future<void>
Renders a view to the response stream, and closes the response.
serialize(dynamic value, {MediaType? contentType}) Future<bool>
Serializes data to the response.
streamFile(File file) Future
Streams a file to this response.
toString() String
A string representation of this object.
inherited
useBuffer() → void
Configure the response to write to an intermediate response buffer, rather than to the stream directly.
write(Object? value, {Encoding? encoding}) → void
Writes data to the response.
override
writeAll(Iterable objects, [String separator = '']) → void
Writes the elements of objects separated by separator.
override
writeCharCode(int charCode) → void
Writes a string containing the character with code point charCode.
override
writeln([Object? obj = '']) → void
Writes the string representation of object followed by a newline.
override

Operators

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

Static Methods

closed() StateError