def METHOD_NAME(self, url, method, content=None, headers={}):
    # Do the HTTP stuff...
    url = self.url_prefix + url
    logger.debug(
        "Sending %s request to %s:%d%s", method, self.host, self.port, url
    )
    if not common.portIsOpen(self.host, self.port, self.timeout):
        raise RestClientException(
            "Cannot connect to %s:%d after %.2f [s]"
            % (self.host, self.port, self.timeout)
        )
    if content and hasattr(content, "read"):
        headers["Transfer-Encoding"] = "chunked"
        content = chunked(content)
    self._conn = http.client.HTTPConnection(self.host, self.port)
    self._conn.request(method, url, content, headers)
    self._resp = self._conn.getresponse()
    # Server errors are encoded in the body as json content
    if self._resp.status != http.HTTPStatus.OK:
        msg = "Error on remote %s@%s:%s%s (status %d): " % (
            method,
            self.host,
            self.port,
            url,
            self._resp.status,
        )
        try:
            error = json.loads(self._resp.read().decode("utf-8"))
            etype = getattr(exceptions, error["type"])
            eargs = error["args"]
            if etype == SubManagerException:
                for host, args in eargs.items():
                    subetype = getattr(exceptions, args["type"])
                    subargs = args["args"]
                    eargs[host] = subetype(*subargs)
                ex = etype(eargs)
            else:
                ex = etype(*eargs)
            if hasattr(ex, "msg"):
                ex.msg = msg + ex.msg
        except Exception:
            ex = RestClientException(msg + "Unknown")
        raise ex
    if not self._resp.length:
        return None, None
    return codecs.getreader("utf-8")(self._resp), self._resp