get function

Future<Response> get(
  1. String url, {
  2. Map<String, String>? headers,
})

Sends an HTTP GET request with the given headers to the given URL.

Implementation

Future<Response> get(String url, {Map<String, String>? headers}) async {
  http_request.Response apiResponse =
      await http_request.get(Uri.parse(url), headers: headers);
  return Response(
      apiResponse.statusCode,
      apiResponse.body,
      apiResponse.bodyBytes,
      apiResponse.contentLength,
      apiResponse.headers,
      apiResponse.isRedirect,
      apiResponse.persistentConnection,
      apiResponse.reasonPhrase,
      apiResponse.request);
}