get method
Implementation
Future<Response> get(url, {Map<String, String>? headers}) async {
try {
final response = await http.get(url, headers: headers);
if (response.statusCode == 401) {
if (json.decode(response.body)['message'] == 'Expired JWT Token') {
throw ExpiredTokenException(response.reasonPhrase);
} else {
throw AuthenticateException(response.reasonPhrase);
}
} else {
return response;
}
} catch (e) {
return http.Response(e.toString(), 500);
}
}