Response class

Constructors

Response.new({required int statusCode, dynamic data, Map<String, String> headers = const {HttpHeaders.contentTypeHeader : 'application/json'}, String contentType = 'application/json'})
Response.bytes({required int statusCode, dynamic data, Map<String, String> headers = const {HttpHeaders.contentTypeHeader : 'application/octet-stream'}})
Response.html({required int statusCode, dynamic data, Map<String, String> headers = const {HttpHeaders.contentTypeHeader : 'text/html'}})
Response.json({required int statusCode, dynamic data, Map<String, String> headers = const {HttpHeaders.contentTypeHeader : 'application/json'}})
Response.text({required int statusCode, dynamic data, Map<String, String> headers = const {HttpHeaders.contentTypeHeader : 'text/plain'}})

Properties

contentType String
final
data → dynamic
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusCode int
final

Methods

convertToJson(dynamic obj) → dynamic
isSerializable(Object obj) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(HttpResponse response) → void
toJson() String
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

from(dynamic value) Response