get static method

Future<Map<String, dynamic>> get({
  1. required String method,
  2. bool isAuth = false,
  3. bool testMode = false,
  4. Map<String, dynamic>? query,
})

Sends an HTTP GET request.

Implementation

static Future<Map<String, dynamic>> get(
    {required String method, bool isAuth = false, bool testMode = false, Map<String, dynamic>? query}) async {
  if (ApiST.instance.baseUrl == null) {
    throw EticonApiError(error: 'Base url not set, use Api.init()');
  }
  if (isAuth) {
    if (Token.instance.token.isEmpty) {
      throw EticonApiError(error: 'Authentication token is empty, use Api.setToken (String url)');
    }
  }
  return await ApiST.instance
      .request(type: TYPE.GET, method: method, isAuth: isAuth, testMode: testMode, query: query);
}