delete static method

Future<ApiResponse> delete(
  1. String path, {
  2. Map<String, String>? headers,
  3. Object? body,
  4. Encoding? encoding,
})

Sends an HTTP DELETE request with the given headers to the given URL.

This automatically initializes a new http.Client and closes that client once the request is complete. If you're planning on making multiple requests to the same server, you should use a single http.Client for all of those requests.

指定されたヘッダーを含む HTTP DELETE 要求を指定された URL に送信します。

これにより、新しい http.Client が自動的に初期化され、リクエストが完了するとそのクライアントが閉じられます。同じサーバーに複数のリクエストを送信する予定がある場合は、それらすべてのリクエストに対して単一の http.Client を使用する必要があります。

Implementation

static Future<ApiResponse> delete(
  String path, {
  Map<String, String>? headers,
  Object? body,
  Encoding? encoding,
}) async {
  final url = Uri.parse(path);
  return http.delete(
    url,
    headers: headers,
    body: body,
    encoding: encoding,
  );
}