Response class

HTTP Response, mainly used to return data to the Requester.

Constructors

Response({required HttpRequest request})
Constuctor

Properties

hashCode int
The hash code for this object.
no setterinherited
request HttpRequest
Request that will be edited
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addHeader(String key, String value) → void
Adds a header to the response
file(File file) Future<void>
Serves a file, useful for downloading a file
html(String htmlContent) Future<void>
Sends an HTML data
json(Map<String, dynamic> data) Future<void>
Sends a json response
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(String content, ContentType contentType) Future<void>
Sends a data with a custom type
staticFile(String path, ContentType contentType) Future<void>
Sends a static file
toString() String
A string representation of this object.
inherited

Operators

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