ping method

Check API server status.

Query path: /ping

Implementation

Future<CoinGeckoResult<bool>> ping() async {
  final response = await _client.dio.get(
    '/ping',
    options: Options(contentType: 'application/json'),
  );
  return CoinGeckoResult(
    response.statusCode == 200,
    errorCode: response.statusCode ?? null,
    errorMessage: '${response.statusMessage} - ${response.data.toString()}',
    isError: response.statusCode != 200,
  );
}