Essence\Http\Client\Native::get PHP Method

get() public method

Retrieves contents from the given URL.
public get ( string $url ) : string
$url string The URL fo fetch contents from.
return string The fetched contents.
    public function get($url)
    {
        $reporting = error_reporting(0);
        $context = $this->_createContext();
        $contents = file_get_contents($url, false, $context);
        error_reporting($reporting);
        if ($contents === false) {
            $code = isset($http_response_header[0]) ? $this->_extractHttpCode($http_response_header[0]) : $this->_defaultCode;
            throw new Exception($url, $code);
        }
        return $contents;
    }