Response.bytes constructor

Response.bytes(
  1. List<int> bytes, {
  2. int status = 200,
  3. String statusText = 'OK',
  4. HeadersInit? headers,
  5. Uri? url,
  6. bool redirected = false,
  7. bool fromCache = false,
})

Creates a replayable response from raw bytes.

Implementation

Response.bytes(
  List<int> bytes, {
  this.status = 200,
  this.statusText = 'OK',
  HeadersInit? headers,
  Uri? url,
  this.redirected = false,
  this.fromCache = false,
}) : body = ResponseBody.fromBytes(bytes),
     headers = Headers(headers),
     url = url ?? Uri();