getSession function

Future<Map<String, dynamic>> getSession(
  1. String sessionId
)

Implementation

Future<Map<String, dynamic>> getSession(String sessionId) async {
  try {
    final response = await http.get(
        Uri.parse('${Constants.DEFAULT_RECLAIM_STATUS_URL}$sessionId'),
        headers: {'Content-Type': 'application/json'});
    if (response.statusCode != 200) {
      throw GetSessionError('Error getting session with sessionId: $sessionId');
    }
    final res = json.decode(response.body);
    return res;
  } catch (err) {
    rethrow;
  }
}