private function retrieveContentFromUrl($url)
    {
        $ctx = $this->prepareContext($url);

        $body = file_get_contents($url, 0, $ctx);

        if (isset($http_response_header)) {
            $code = substr($http_response_header[0], 9, 3);
            if (floor($code / 100) > 3) {
                throw new \Exception($http_response_header[0]);
            }
        } else {
            throw new \Exception('Request failed.');
        }

        return $body;
    }
private function retrieveContentFromUrl($url)
    {
        $ctx = $this->prepareContext($url);

        $body = file_get_contents($url, 0, $ctx);

        if (isset($http_response_header)) {
            $code = substr($http_response_header[0], 9, 3);
            if (floor($code / 100) > 3) {
                throw new \Exception($http_response_header[0]);
            }
        } else {
            throw new \Exception('Request failed.');
        }

        return $body;
    }
private function retrieveContentFromUrl ( $ url ) { $ ctx = $ this -> prepareContext ( $ url ) ; $ body = file_get_contents ( $ url , 0 , $ ctx ) ; if ( isset ( $ http_response_header ) ) { $ code = substr ( $ http_response_header [ 0 ] , 9 , 3 ) ; if ( floor ( $ code / 100 ) > 3 ) { throw new \ Exception ( $ http_response_header [ 0 ] ) ; } } else { throw new \ Exception ( 'Request failed.' ) ; } return $ body ; }
Retrieves the body-content from the provided URL.

@param  string $url
@return string
@throws \Exception if status code is above 300
Retrieves the body - content from the provided URL .