From bd42f20289b6b00a730a514c1afb0c7ef07a60e0 Mon Sep 17 00:00:00 2001 From: Marcos Pereira Date: Tue, 5 Sep 2017 11:45:05 -0300 Subject: [PATCH] Added HTTP Delete. --- keycloak/connection.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/keycloak/connection.py b/keycloak/connection.py index d38d2ab..808edb6 100644 --- a/keycloak/connection.py +++ b/keycloak/connection.py @@ -162,3 +162,22 @@ class ConnectionManager(object): except Exception as e: raise KeycloakConnectionError( "Can't connect to server (%s)" % e) + + def raw_delete(self, path, **kwargs): + """ Submit delete request to the path. + + :arg + path (str): Path for request. + :return + Response the request. + :exception + HttpError: Can't connect to server. + """ + try: + return requests.delete(urljoin(self.base_url, path), + params=kwargs, + headers=self.headers, + timeout=self.timeout) + except Exception as e: + raise KeycloakConnectionError( + "Can't connect to server (%s)" % e)