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, int statusCode,
    {BaseRequest? request,
    Map<String, String> headers = const {},
    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);