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> - Sends the file at the given path to the client.
-
html(
String htmlContent) → Future< void> -
Sends an HTML response with the provided
htmlContent. -
json(
dynamic data) → Future< void> -
Sends a JSON response with the provided
data. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send(
String content, ContentType contentType) → Future< void> -
Sends a response with the provided
contentandcontentType. -
staticFile(
String path, ContentType contentType) → Future< void> - Sends the file at the given path to the client.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited