src/SitemapParser.php
protected function getContent()
    {
        $this->currentURL = $this->urlEncode($this->currentURL);
        if (!$this->urlValidate($this->currentURL)) {
            throw new SitemapParserException('Invalid URL');
        }
        try {
            if (!isset($this->config['guzzle']['headers']['User-Agent'])) {
                $this->config['guzzle']['headers']['User-Agent'] = $this->userAgent;
            }
            $client = new GuzzleHttp\Client();
            $res = $client->request('GET', $this->currentURL, $this->config['guzzle']);
            return $res->getBody();
        } catch (GuzzleHttp\Exception\TransferException $e) {
            throw new SitemapParserException($e->getMessage());
        }
    }
protected function getContent()
    {
        $this->currentURL = $this->urlEncode($this->currentURL);
        if (!$this->urlValidate($this->currentURL)) {
            throw new SitemapParserException('Invalid URL');
        }
        try {
            if (!isset($this->config['guzzle']['headers']['User-Agent'])) {
                $this->config['guzzle']['headers']['User-Agent'] = $this->userAgent;
            }
            $client = new GuzzleHttp\Client();
            $res = $client->request('GET', $this->currentURL, $this->config['guzzle']);
            return $res->getBody();
        } catch (GuzzleHttp\Exception\TransferException $e) {
            throw new SitemapParserException($e->getMessage());
        }
    }
protected function getContent ( ) { $ this -> currentURL = $ this -> urlEncode ( $ this -> currentURL ) ; if ( ! $ this -> urlValidate ( $ this -> currentURL ) ) { throw new SitemapParserException ( 'Invalid URL' ) ; } try { if ( ! isset ( $ this -> config [ 'guzzle' ] [ 'headers' ] [ 'User-Agent' ] ) ) { $ this -> config [ 'guzzle' ] [ 'headers' ] [ 'User-Agent' ] = $ this -> userAgent ; } $ client = new GuzzleHttp \ Client ( ) ; $ res = $ client -> request ( 'GET' , $ this -> currentURL , $ this -> config [ 'guzzle' ] ) ; return $ res -> getBody ( ) ; } catch ( GuzzleHttp \ Exception \ TransferException $ e ) { throw new SitemapParserException ( $ e -> getMessage ( ) ) ; } }
Request the body content of an URL

@return string Raw body content
@throws SitemapParserException
Request the body content of an URL