read method

Reads body fully and returns a flattened AWSHttpResponse.

this will no longer be usable after this completes.

Implementation

Future<AWSHttpResponse> read() async {
  try {
    return AWSHttpResponse(
      statusCode: statusCode,
      headers: headers,
      body: await bodyBytes,
    );
  } finally {
    unawaited(close());
  }
}