Get method

  1. @override
Future Get(
  1. dynamic request, {
  2. String route = "/Fetch/GetPacket",
})
override

Implementation

@override
Future<dynamic> Get(request, {String route = "/Fetch/GetPacket"}) async {
  Response returnResponse;

  try {
    Map<String, String> headers = {"Content-Type": "application/json"};
    String url = Configuration.GeoCodingSource.GlideGoConfig.BaseURL + route;
    http.Response response = await http
        .post(Uri.parse(url), headers: headers, body: json.encode(request))
        .timeout(
      const Duration(seconds: 60),
      onTimeout: () {
        throw FetchDataException('Request timeout');
      },
    );
    returnResponse = Response(
        _returnResponse(response), response.statusCode, response.headers);
  } on SocketException {
    throw FetchDataException('No Internet connection');
  }
  return returnResponse;
}