public function sendRequest($url, $params, $method)
    {
        try{
            if (!empty($params['html'])){
                $commandName = 'GenerateFromHTML';
            }
            else if (!empty($params['url'])){
                $commandName = 'GenerateFromURL';
            }
            else if (!empty($params['file'])&& $url=='pdf'){
                $commandName = 'GenerateFromFile';
            }
            else {
                $operations = $this->getDescription()->getOperations();
                foreach ($operations as $operation)
                {
                    if ($operation->getUri()==$url && $operation->getHttpMethod() == $method)
                    {
                        $commandName = $operation->getName();
                    }
                }
            }
            $command = $this->getCommand($commandName, $params);
            $ret = $this->execute($command);

            if ( $commandName == 'GetAssetList' || $commandName == 'UploadAsset' )
            {
                return json_encode($ret);
            }
            return $ret->getBody(true);

        }catch(ClientErrorResponseException $exception){
            throw new \Exception($exception->getResponse()->getBody(true), $exception->getResponse()->getStatusCode());
        }
    }