如何在我的删除HTTP请求中添加正文

Moh*_*dri 3 dart flutter

我想在我的删除http请求中添加一个正文,但是http pakage似乎不接受它

http.delete('${config.basicUrl}removeFavorite', body: json.encode(requestBody))
Run Code Online (Sandbox Code Playgroud)

有什么解决办法吗?

Ski*_*Ski 5

  final client = http.Client();
  try {
    final response = await client.send(
        http.Request("DELETE", Uri.parse("${config.basicUrl}removeFavorite"))
          ..headers["authorization"] = "Bearer $bearer"
          ..body = "...");
    //
  } finally {
    client.close();
  }
Run Code Online (Sandbox Code Playgroud)