Response.bytes(List<int> bodyBytes, int statusCode, { BaseRequest request, Map<String, String> headers: const {}, bool isRedirect: false, bool persistentConnection: true, String reasonPhrase })

Create a new HTTP response with a byte array body.

Source

Response.bytes(
    List<int> bodyBytes,
    int statusCode,
    {BaseRequest request,
     Map<String, String> headers: const <String, String>{},
     bool isRedirect: false,
     bool persistentConnection: true,
     String reasonPhrase})
  : bodyBytes = toUint8List(bodyBytes),
    super(
      statusCode,
      contentLength: bodyBytes.length,
      request: request,
      headers: headers,
      isRedirect: isRedirect,
      persistentConnection: persistentConnection,
      reasonPhrase: reasonPhrase);