diff --git a/keystoneclient/client.py b/keystoneclient/client.py index 2e472d5fc..020dfc1b0 100644 --- a/keystoneclient/client.py +++ b/keystoneclient/client.py @@ -107,6 +107,9 @@ class HTTPClient(httplib2.Http): if self.debug_log: _logger.debug("RESP: %s\nRESP BODY: %s\n", resp, body) + def serialize(self, entity): + return json.dumps(entity) + def request(self, url, method, **kwargs): """ Send an http request with the specified characteristics. @@ -119,7 +122,7 @@ class HTTPClient(httplib2.Http): request_kwargs['headers']['User-Agent'] = self.USER_AGENT if 'body' in kwargs: request_kwargs['headers']['Content-Type'] = 'application/json' - request_kwargs['body'] = json.dumps(kwargs['body']) + request_kwargs['body'] = self.serialize(kwargs['body']) self.http_log_req((url, method,), request_kwargs) resp, body = super(HTTPClient, self).request(url,