def send_request(self, method, path, body=None, query_string_args={},encode_json=True):
        if query_string_args:
            path = "?".join([path, urlencode(query_string_args)])

        kwargs = { 'timeout': self.request_timeout }
        url = self.es_url + path

        if body:
            if encode_json:
                kwargs['data'] = json.dumps(body)
            else:
                kwargs['data'] = body

        if not hasattr(requests, method.lower()):
            raise ESClientException("No such HTTP Method '%s'!" %
                                    method.upper())

        self.last_response = requests.request(method.lower(), url, **kwargs)
        log.debug(self.last_response)
Make a raw HTTP request to ElasticSearch.
dataset/ETHPy150Open eriky/ESClient/esclient.py/ESClient.send_request