requestSite static method

Future<Document?> requestSite(
  1. String url, {
  2. Map<String, String>? header,
})

Implementation

static Future<dom.Document?> requestSite(String url,
     {Map<String, String>? header}) async {
   try {
     final uri = Uri.parse(url);
     final response = await http.get(uri, headers: header);
     dom.Document html = dom.Document.html(response.body);

     return html;
   } catch (e) {
     return null;
   }
 }