delete static method

dynamic delete(
  1. String path,
  2. Object item
)

Implementation

static delete(String path, Object item) async {
  final config = CConfig();

  try {
    var result = await http.delete(Uri.parse('${config.serverUrl}$path'),
        headers: {
          'Content-Type': 'application/json',
          'Authorization': 'Bearer ${config.token}'
        },
        body: jsonEncode(item));
    if (result.statusCode == 200) {}
  } catch (e) {
    if (kDebugMode) {
      print(e);
    }
  }
}