ElasticSearch\Transport\Memcached::request PHP Method

request() public method

Perform a request against the given path/method/payload combination Example: $es->request('/_status');
public request ( string | array $path, string $method = "GET", array | boolean $payload = false ) : array
$path string | array
$method string
$payload array | boolean
return array
    public function request($path, $method = "GET", $payload = false)
    {
        $url = $this->buildUrl($path);
        switch ($method) {
            case 'GET':
                $result = $this->conn->get($url);
                break;
            case 'DELETE':
                $result = $this->conn->delete($url);
                break;
        }
        return json_decode($result);
    }