aboutsummaryrefslogtreecommitdiff
path: root/lib/Matrix/Client
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Matrix/Client')
-rw-r--r--lib/Matrix/Client/Requester.pm68
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Matrix/Client/Requester.pm6 b/lib/Matrix/Client/Requester.pm6
index 22c91c6..1a60014 100644
--- a/lib/Matrix/Client/Requester.pm6
+++ b/lib/Matrix/Client/Requester.pm6
@@ -80,3 +80,11 @@ multi method put(Str $path, Str $json) {
multi method put(Str $path, *%params) {
self.put($path, to-json(%params))
}
+
+method delete(Str $path) {
+ my $encoded-path = $path.subst('#', '%23');
+ my $req = HTTP::Request.new(
+ DELETE => $.base-url ~ $encoded-path ~ "?{self!access-token-arg}",
+ Content-Type => 'application/json');
+ return self!handle-error($!ua.request($req))
+}