From 1bfca23459329d5288a81231bb4e15b6641b40f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20K=C3=B6pke?= Date: Fri, 3 Jul 2020 17:45:58 +0200 Subject: [PATCH 1/5] added optional body to delete --- lib/src/base_client.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/base_client.dart b/lib/src/base_client.dart index fa8169b7ef..785f116fdc 100644 --- a/lib/src/base_client.dart +++ b/lib/src/base_client.dart @@ -42,8 +42,9 @@ abstract class BaseClient implements Client { _sendUnstreamed('PATCH', url, headers, body, encoding); @override - Future delete(url, {Map headers}) => + Future delete(url, {Map headers, body}) => _sendUnstreamed('DELETE', url, headers); + @override Future read(url, {Map headers}) async { final response = await get(url, headers: headers); From f279924bb074376542987d34f22944c7eba43bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20K=C3=B6pke?= Date: Sun, 23 Aug 2020 10:59:32 +0200 Subject: [PATCH 2/5] added optional encoding parameter to DELETE method --- lib/src/base_client.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/base_client.dart b/lib/src/base_client.dart index 785f116fdc..cf0eb2d5c6 100644 --- a/lib/src/base_client.dart +++ b/lib/src/base_client.dart @@ -42,8 +42,9 @@ abstract class BaseClient implements Client { _sendUnstreamed('PATCH', url, headers, body, encoding); @override - Future delete(url, {Map headers, body}) => - _sendUnstreamed('DELETE', url, headers); + Future delete(url, + {Map headers, body, Encoding encoding}) => + _sendUnstreamed('DELETE', url, headers, body, encoding); @override Future read(url, {Map headers}) async { From 0d747ab184c84e91b9bfde55ccc42f323b914d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20K=C3=B6pke?= Date: Mon, 24 Aug 2020 12:57:58 +0200 Subject: [PATCH 3/5] added delete body/encoding to global delete function and abstract Client --- lib/http.dart | 6 ++++-- lib/src/client.dart | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/http.dart b/lib/http.dart index c7dc9bfdbc..2913469eea 100644 --- a/lib/http.dart +++ b/lib/http.dart @@ -125,8 +125,10 @@ Future patch(url, /// the same server, you should use a single [Client] for all of those requests. /// /// For more fine-grained control over the request, use [Request] instead. -Future delete(url, {Map headers}) => - _withClient((client) => client.delete(url, headers: headers)); +Future delete(url, + {Map headers, body, Encoding encoding}) => + _withClient((client) => + client.delete(url, headers: headers, body: body, encoding: encoding)); /// Sends an HTTP GET request with the given headers to the given URL, which can /// be a [Uri] or a [String], and returns a Future that completes to the body of diff --git a/lib/src/client.dart b/lib/src/client.dart index d877ce5413..00a7761cd0 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -113,7 +113,8 @@ abstract class Client { /// which can be a [Uri] or a [String]. /// /// For more fine-grained control over the request, use [send] instead. - Future delete(url, {Map headers}); + Future delete(url, + {Map headers, body, Encoding encoding}); /// Sends an HTTP GET request with the given headers to the given URL, which /// can be a [Uri] or a [String], and returns a Future that completes to the From 8c3b6924fa85c7bc9f5276c2cf625e078b26fa23 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 5 Jan 2021 14:59:22 -0800 Subject: [PATCH 4/5] Add changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 353b11ba6d..e08586b2dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ null safety allow list. * Add `const` constructor to `ByteStream`. * Migrate `BrowserClient` from `blob` to `arraybuffer`. +* **Breaking** Added a `body` and `encoding` argument to `Client.delete`. This + is only breaking for implementations which override that method. ## 0.12.2 From 093223485de90087d03559eb51006f6581a93052 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 5 Jan 2021 15:02:17 -0800 Subject: [PATCH 5/5] Fix bad merge, forward arguments to _sendUnstreamed --- lib/src/base_client.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/base_client.dart b/lib/src/base_client.dart index 3a1a29e545..52eae4baf5 100644 --- a/lib/src/base_client.dart +++ b/lib/src/base_client.dart @@ -44,7 +44,7 @@ abstract class BaseClient implements Client { @override Future delete(Object url, {Map? headers, Object? body, Encoding? encoding}) => - _sendUnstreamed('DELETE', url, headers); + _sendUnstreamed('DELETE', url, headers, body, encoding); @override Future read(Object url, {Map? headers}) async {