createSession method

Future<String?> createSession()

Creates a new session for a user and returns the session ID.

IBM deletes sessions automatically after 5 minutes of inactivity.

Implementation

Future<String?> createSession() async {
  final path = _buildPath(RequestType.Session);

  final res = await Dio().post(path, options: options);

  return res.data['session_id'];
}