protected function runQuery($action, $arguments, $throw=false)
    {
        $host = $this->getHost();
        $client = new Client(['base_uri' => $host]);
        try{
          $response = $client->post('/json-api/' . $action, [
              'headers' => $this->createHeader(),
              // 'body'    => $arguments[0],
              'verify' => false,
              'query' => $arguments,
              'timeout' => $this->getTimeout(),
              'connect_timeout' => $this->getConnectionTimeout()
          ]);

          return (string) $response->getBody();
        }
        catch(\GuzzleHttp\Exception\ClientException $e)
        {
          if ($throw) {
            throw $e; 
          }
          return $e->getMessage();
        }
    }
protected function runQuery($action, $arguments, $throw=false)
    {
        $host = $this->getHost();
        $client = new Client(['base_uri' => $host]);
        try{
          $response = $client->post('/json-api/' . $action, [
              'headers' => $this->createHeader(),
              // 'body'    => $arguments[0],
              'verify' => false,
              'query' => $arguments,
              'timeout' => $this->getTimeout(),
              'connect_timeout' => $this->getConnectionTimeout()
          ]);

          return (string) $response->getBody();
        }
        catch(\GuzzleHttp\Exception\ClientException $e)
        {
          if ($throw) {
            throw $e; 
          }
          return $e->getMessage();
        }
    }
protected function runQuery ( $ action , $ arguments , $ throw = false ) { $ host = $ this -> getHost ( ) ; $ client = new Client ( [ 'base_uri' => $ host ] ) ; try { $ response = $ client -> post ( '/json-api/' . $ action , [ 'headers' => $ this -> createHeader ( ) , // 'body'    => $arguments[0], 'verify' => false , 'query' => $ arguments , 'timeout' => $ this -> getTimeout ( ) , 'connect_timeout' => $ this -> getConnectionTimeout ( ) ] ) ; return ( string ) $ response -> getBody ( ) ; } catch ( \ GuzzleHttp \ Exception \ ClientException $ e ) { if ( $ throw ) { throw $ e ; } return $ e -> getMessage ( ) ; } }
The executor. It will run API function and get the data.

@param string $action function name that will be called.
@param string $arguments list of parameters that will be attached.
@param bool   $throw defaults to false, if set to true rethrow every exception.

@return array results of API call

@since v1.0.0
The executor . It will run API function and get the data .