ResponseStream class

A response where the contents come from a stream.

Use this type of response when the content contains binary data and/or the contents is to be streamed.

Use this type of response when the content is produced as a Stream. If the contents is a stream of text (String), use this type of response, but produce a binary stream by converting the String into binary data using the String.codeUnits method.

Inheritance

Constructors

ResponseStream(ContentType ct)
Constructor.

Properties

contentType ContentType?
Content-type of the response.
getter/setter pairinherited
cookies List<Cookie>
Cookies in the response.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
session Session?
Gets the session.
getter/setter pairinherited
status int
HTTP status code.
getter/setter pairinherited

Methods

addStream(Request req, Stream<List<int>> stream) Future<ResponseStream>
Provide a stream that produces the content.
cookieAdd(Cookie cookie) → void
Set a cookie.
inherited
cookieDelete(String name, [String? path, String? domain]) → void
Delete a cookie.
inherited
finish(Request req) Future
Method that is invoked at the end of creating the HTTP response.
inherited
headerAdd(String name, String value) → void
Adds a HTTP header
inherited
headerAddDate(String name, DateTime date) → void
Adds a HTTP header containing a RFC1123 formatted date.
inherited
headerExists(String name) bool
Whether a header has been set or not.
inherited
headerNames() Iterable<String>
Header names
inherited
headerRemove(String name, [String? value]) bool
Removes named header
inherited
headerRemoveAll() → void
Remove all headers.
inherited
headerSet(String name, String value) → void
Sets a HTTP header
inherited
headerValues(String name) Iterable<String>?
Header values
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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