httpGet function

Future<Response> httpGet(
  1. String uri,
  2. String name, {
  3. Map<String, String>? headers,
})

Implementation

Future<http.Response> httpGet(String uri, String name,
    {Map<String, String>? headers}) async {
  var url = Uri.https(uri, name);

  var response = await http.get(url);

  if (response.statusCode != 200) {
    throw Exception(
      'Could not get network asset',
    );
  }
  return response;
}