src/TelegramClient.php
public function sendRequest(TelegramRequest $request)
    {
        list($url, $method, $headers, $isAsyncRequest) = $this->prepareRequest($request);

        $timeOut = $request->getTimeOut();
        $connectTimeOut = $request->getConnectTimeOut();

        $options = $this->getOptions($request, $method);

        $rawResponse = $this->httpClientHandler->send($url, $method, $headers, $options, $timeOut, $isAsyncRequest, $connectTimeOut);

        $returnResponse = $this->getResponse($request, $rawResponse);

        if ($returnResponse->isError()) {
            throw $returnResponse->getThrownException();
        }

        return $returnResponse;
    }
public function sendRequest(TelegramRequest $request)
    {
        list($url, $method, $headers, $isAsyncRequest) = $this->prepareRequest($request);

        $timeOut = $request->getTimeOut();
        $connectTimeOut = $request->getConnectTimeOut();

        $options = $this->getOptions($request, $method);

        $rawResponse = $this->httpClientHandler->send($url, $method, $headers, $options, $timeOut, $isAsyncRequest, $connectTimeOut);

        $returnResponse = $this->getResponse($request, $rawResponse);

        if ($returnResponse->isError()) {
            throw $returnResponse->getThrownException();
        }

        return $returnResponse;
    }
public function sendRequest ( TelegramRequest $ request ) { list ( $ url , $ method , $ headers , $ isAsyncRequest ) = $ this -> prepareRequest ( $ request ) ; $ timeOut = $ request -> getTimeOut ( ) ; $ connectTimeOut = $ request -> getConnectTimeOut ( ) ; $ options = $ this -> getOptions ( $ request , $ method ) ; $ rawResponse = $ this -> httpClientHandler -> send ( $ url , $ method , $ headers , $ options , $ timeOut , $ isAsyncRequest , $ connectTimeOut ) ; $ returnResponse = $ this -> getResponse ( $ request , $ rawResponse ) ; if ( $ returnResponse -> isError ( ) ) { throw $ returnResponse -> getThrownException ( ) ; } return $ returnResponse ; }
Send an API request and process the result.

@param TelegramRequest $request

@throws TelegramSDKException

@return TelegramResponse
Send an API request and process the result .