protected function sendRequest($request)
    {
        $response = $request->send();

        if (!$response->getIsOk()) {
            throw new InvalidResponseException($response, 'Request failed with code: ' . $response->getStatusCode() . ', message: ' . $response->getContent());
        }

        return $response->getData();
    }
protected function sendRequest($request)
    {
        $response = $request->send();

        if (!$response->getIsOk()) {
            throw new InvalidResponseException($response, 'Request failed with code: ' . $response->getStatusCode() . ', message: ' . $response->getContent());
        }

        return $response->getData();
    }
protected function sendRequest ( $ request ) { $ response = $ request -> send ( ) ; if ( ! $ response -> getIsOk ( ) ) { throw new InvalidResponseException ( $ response , 'Request failed with code: ' . $ response -> getStatusCode ( ) . ', message: ' . $ response -> getContent ( ) ) ; } return $ response -> getData ( ) ; }
Sends the given HTTP request, returning response data.
@param \yii\httpclient\Request $request HTTP request to be sent.
@return array response data.
@throws InvalidResponseException on invalid remote response.
@since 2.1
Sends the given HTTP request returning response data .