get method
Implementation
@override
Future<Map<String, dynamic>> get(String api, Map<String, dynamic>? headers,
Map<String, dynamic>? params) async {
try {
final request = await _httpClient.getUrl(_makeUri(api, params));
_addHeader(request, headers);
request.headers.contentType = ContentType('application', 'json');
final response = await request.close();
if (response.statusCode == 200) {
final responseBody = await response.transform(utf8.decoder).join();
return json.decode(responseBody) as Map<String, dynamic>;
}
throw (response.statusCode);
} catch (error) {
rethrow;
}
}