ResponseData.fromHttpResponse constructor

ResponseData.fromHttpResponse(
  1. Response response
)

Creates a new response data from an HTTP response.

Implementation

factory ResponseData.fromHttpResponse(Response response) {
  return ResponseData(
    response.bodyBytes,
    response.statusCode,
    headers: response.headers,
    body: response.body,
    contentLength: response.contentLength,
    isRedirect: response.isRedirect,
    persistentConnection: response.persistentConnection,
    request: (response.request != null)
        ? RequestData.fromHttpRequest(response.request!)
        : null,
  );
}