delete method

Future<Response?> delete()

Implementation

Future<http.Response?> delete() async {
  final random = getRandomString(10);
  final ENVData data = readConfig();
  _alertNotPost(data);
  await _methodDeploy(data, () async {
    data.replacementId ??= random;

    final token = await Session.load('token');

    data.globalData?.header ??= {
      'Accept': 'application/json',
    };

    if (token != null) data.globalData?.header!.addAll({'Authorization': token!});

    final d = await APIMultiThread().config(data).run(Api.delete);

    if (data.isLoading) {
      Loading.requestStack.remove(data.replacementId ?? random);

      if (!Loading.loadingProgress()) {
        Loading.close();
      }
    }
    return d;
  });
  return null;
}