static function resolveURLToData(string $url, ?array $requestHeaders = null) {
        if($requestHeaders === null) {
            $requestHeaders = array();
        }
        
        foreach($requestHeaders as $key => $val) {
            unset($requestHeaders[$key]);
            $nkey = \ucwords($key, '-');
            $requestHeaders[$nkey] = $val;
        }
        
        if(empty($requestHeaders['User-Agent'])) {
            $requestHeaders['User-Agent'] = static::DEFAULT_USER_AGENT;
        }
        
        $request = new \RingCentral\Psr7\Request('GET', $url, $requestHeaders);
        
        return static::makeRequest($request)->then(function ($response) {
            $body = (string) $response->getBody();
            return $body;
        });
    }
static function resolveURLToData(string $url, ?array $requestHeaders = null) {
        if($requestHeaders === null) {
            $requestHeaders = array();
        }
        
        foreach($requestHeaders as $key => $val) {
            unset($requestHeaders[$key]);
            $nkey = \ucwords($key, '-');
            $requestHeaders[$nkey] = $val;
        }
        
        if(empty($requestHeaders['User-Agent'])) {
            $requestHeaders['User-Agent'] = static::DEFAULT_USER_AGENT;
        }
        
        $request = new \RingCentral\Psr7\Request('GET', $url, $requestHeaders);
        
        return static::makeRequest($request)->then(function ($response) {
            $body = (string) $response->getBody();
            return $body;
        });
    }
static function resolveURLToData ( string $ url , ? array $ requestHeaders = null ) { if ( $ requestHeaders === null ) { $ requestHeaders = array ( ) ; } foreach ( $ requestHeaders as $ key => $ val ) { unset ( $ requestHeaders [ $ key ] ) ; $ nkey = \ ucwords ( $ key , '-' ) ; $ requestHeaders [ $ nkey ] = $ val ; } if ( empty ( $ requestHeaders [ 'User-Agent' ] ) ) { $ requestHeaders [ 'User-Agent' ] = static :: DEFAULT_USER_AGENT ; } $ request = new \ RingCentral \ Psr7 \ Request ( 'GET' , $ url , $ requestHeaders ) ; return static :: makeRequest ( $ request ) -> then ( function ( $ response ) { $ body = ( string ) $ response -> getBody ( ) ; return $ body ; } ) ; }
Asynchronously resolves a given URL to the response body. Resolves with a string.
@param string      $url
@param array|null  $requestHeaders
@return \React\Promise\ExtendedPromiseInterface
Asynchronously resolves a given URL to the response body . Resolves with a string .