RestResponse constructor

RestResponse({
  1. required Uint8List? data,
  2. required Map<String, String>? headers,
  3. required int statusCode,
})

An HTTP response from a REST API call.

Implementation

RestResponse({
  required Uint8List? data,
  required this.headers,
  required this.statusCode,
}) : data = data ?? Uint8List(0) {
  body = utf8.decode(this.data, allowMalformed: true);
}