Http2ResponseContext class
Properties
-
app
↔ Angel?
-
The Angel instance that is sending a response.
getter/setter pairinherited
-
buffer
→ BytesBuilder?
-
A set of UTF-8 encoded bytes that will be written to the response.
no setteroverride
-
canPush
→ bool
-
Returns
true if an attempt to push a resource will succeed.
no setter
-
chunked
↔ bool?
-
Is
Transfer-Encoding chunked?
getter/setter pairinherited
-
contentLength
↔ int?
-
Gets or sets the content length to send back to a client.
getter/setter pairinherited
-
contentType
↔ MediaType
-
Gets or sets the content type to send back to a client.
getter/setter pairinherited
-
cookies
→ List<Cookie>
-
Any and all cookies to be sent to the user.
finalinherited
-
correspondingRequest
→ RequestContext?
-
Points to the RequestContext corresponding to this response.
no setteroverride
-
done
→ Future
-
Completes once the response is closed (see close), or with the first
error passed to addError. Never completes for a detached response.
no setterinherited
-
encoders
→ Map<String, Converter<List<int>, List<int>>>
-
A set of Converter objects that can be used to encode response data.
finalinherited
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
hasPendingFinalizers
→ bool
-
Whether Angel.responseFinalizers have yet to run for this response.
no setterinherited
-
Headers that will be sent to the user.
no setterinherited
-
Whether the status and headers have been sent, as by an unbuffered
response that has started its body. After that, an error can no longer
be answered with an error response: the response is aborted instead.
no setteroverride
-
isBuffered
→ bool
-
Returns
true if response data is being written to a buffer, rather than to the underlying stream.
no setteroverride
-
isOpen
→ bool
-
Returns
true if the response is still available for processing by Angel.
no setteroverride
-
properties
→ Map
-
finalinherited
-
pushes
→ List<Http2ResponseContext>
-
Returns a List of all resources that have pushed to the client.
no setter
-
rawResponse
→ ServerTransportStream
-
The underlying
RawResponse under this instance.
no setteroverride
-
renderParams
→ Map<String, dynamic>
-
A Map of data to inject when
res.render is called.
finalinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
selectedEncoder
→ ({Converter<List<int>, List<int>> encoder, String name})?
-
The encoder from encoders to apply to this response, chosen by the
request's
Accept-Encoding header, or null for none.
no setterinherited
-
serializer
↔ FutureOr<String> Function(dynamic)
-
Serializes response data into a String.
getter/setter pairinherited
-
statusCode
↔ int
-
This response's status code.
getter/setter pairinherited
-
stream
→ ServerTransportStream
-
final
-
targetUri
→ Uri?
-
no setter
Methods
-
abort(Object error, [StackTrace? stackTrace])
→ Future<void>
-
Resets the stream, so the client sees it fail.
override
-
add(List<int> data)
→ void
-
Adds a data
event to the sink.
override
-
addError(Object error, [StackTrace? stackTrace])
→ void
-
Fails done with
error. Unless something listens to done, the
error is also reported to the current zone (the request's error zone),
as nothing else would see it.
inherited
-
addStream(Stream<List<int>> stream)
→ Future
-
Adds a stream directly the underlying response.
override
-
close()
→ Future
-
Prevents more data from being written to the response, and locks it entire from further editing.
override
-
detach()
→ ServerTransportStream
-
Signals Angel that the response is being held alive deliberately, and that the framework should not automatically close it.
override
-
download(File file, {String? filename})
→ Future<void>
-
Sends a download as a response.
inherited
-
json(Object? value)
→ Future<bool>
-
Serializes JSON to the response.
inherited
-
jsonp(Object value, {String callbackName = 'callback', MediaType? contentType})
→ Future<void>
-
Returns a JSONP response.
inherited
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
push(String path, {String method = 'GET'})
→ Http2ResponseContext
-
Pushes a resource to the client.
-
redirect(Object? url, {bool absolute = true, int? code})
→ Future<void>
-
Redirects to user to the given URL.
inherited
-
redirectTo(String name, [Map? params, int? code])
→ Future<void>
-
Redirects to the given named Route.
inherited
-
redirectToAction(String action, [Map? params, int? code])
→ Future<void>
-
Redirects to the given Controller action.
inherited
-
render(String view, [Map<String, dynamic>? data])
→ Future<void>
-
Renders a view to the response stream, and closes the response.
inherited
-
runFinalizers([RequestContext? request])
→ Future<void>
-
Runs Angel.responseFinalizers for this response, at most once.
inherited
-
serialize(Object? value, {MediaType? contentType})
→ Future<bool>
-
Serializes data to the response.
inherited
-
streamFile(File file)
→ Future
-
Streams a file to this response.
inherited
-
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.
override
-
Throws a 500 AngelHttpException naming any of headers that cannot
be sent, after removing them so that the error response can be.
inherited
-
write(Object? value, {Encoding? encoding})
→ void
-
Writes data to the response.
inherited
-
writeAll(Iterable objects, [String separator = ''])
→ void
-
Writes the elements of
objects separated by separator.
inherited
-
writeCharCode(int charCode)
→ void
-
Writes a string containing the character with code point
charCode.
inherited
-
writeln([Object? obj = ''])
→ void
-
Writes the string representation of
object followed by a newline.
inherited