StreamResponse class

Response that writes the stream of bytes provided in body to the response.

Inheritance

Constructors

StreamResponse({Stream<List<int>>? body, dynamic statusCode = 200, Map<String, dynamic>? headers, String? mimeType, String? charset, List<Cookie>? cookies})
StreamResponse.fromFile(File file, {dynamic statusCode = 200, Map<String, dynamic>? headers, String? mimeType, String? charset, List<Cookie>? cookies})
Response that writes the contents of file to the response.
factory
StreamResponse.fromStrings(Stream<String> strings, {dynamic statusCode = 200, Map<String, dynamic>? headers, String? mimeType, String? charset, Encoding encoding = cnv.utf8, List<Cookie>? cookies})
Response that writes the strings to the response.
factory

Properties

body Stream<List<int>>?
Body of the response
getter/setter pairinherited
cookies List<Cookie>
Cookies
finalinherited
hashCode int
The hash code for this object.
no setterinherited
headers JaguarHttpHeaders
Headers
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int
Status code of the response
getter/setter pairinherited

Methods

deleteCookie(String name, {String path = '/'}) → void
deleteCookie deletes a cookie with given name. Use path to specify the path from which the cookie has to be removed.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
writeAllButBody(HttpResponse resp) → void
inherited
writeResponse(HttpResponse resp) Future<void>
Writes body of the HTTP response from body property
override

Operators

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

Static Methods

fromPath(String path, {int statusCode = 200, Map<String, dynamic>? headers, String? mimeType, String? charset, List<Cookie>? cookies}) Future<StreamResponse>
Response that writes the contents of file at path to the response.