getServerStatus method

Future<CheckServerModel> getServerStatus({
  1. BaseUrlSchema schema = BaseUrlSchema.https,
})

Retrieves the server status.

The schema parameter (optional) specifies the URL schema to use (default is BaseUrlSchema.https).

Implementation

Future<CheckServerModel> getServerStatus({
  BaseUrlSchema schema = BaseUrlSchema.https,
}) async {
  try {
    final response = await dio.get('/server/status', queryParameters: {
      'endpoint': baseUrl,
      'protocol': schema.toUrlSchema()
    });
    return CheckServerModel.fromJson(response.data);
  } on DioError catch (e) {
    throw e.toServerException();
  }
}