Response.bytes constructor

Response.bytes(
  1. List<int> bodyBytes,
  2. int statusCode, {
  3. BaseRequest? request,
  4. Map<String, String> headers = const {},
  5. bool isRedirect = false,
  6. bool persistentConnection = true,
  7. String? reasonPhrase,
})

Create a new HTTP response with a byte array body.

Implementation

Response.bytes(List<int> bodyBytes, super.statusCode,
    {super.request,
    super.headers,
    super.isRedirect,
    super.persistentConnection,
    super.reasonPhrase})
    : bodyBytes = toUint8List(bodyBytes),
      super(contentLength: bodyBytes.length);