responseToDocument static method

Document? responseToDocument(
  1. Response response
)

Takes an http.Response and returns a html.Document

Implementation

static Document? responseToDocument(http.Response response) {
  if (response.statusCode != 200) {
    return null;
  }

  Document? document;
  try {
    document = parser.parse(utf8.decode(response.bodyBytes));
  } catch (err) {
    return document;
  }

  return document;
}