src/Fetch.php
static public function secureUrl($url, $params = []) {
        if (is_array($url)) {
            $url = implode("/", $url);
        }
        $headers = [
            "Authorization: Bearer " . JWT::getInternalToken()
        ];
        $opts = [
            "http" => [
                "method" => "GET",
                "header" => implode("\r\n", $headers)
            ],
            "ssl" => array(
                "verify_peer" => false,
                "verify_peer_name" => false,
            )
        ];
        $stream_context = stream_context_create($opts);
        if (count($params)) {
            $url = $url . "?" . http_build_query($params);
        }
        syslog(LOG_INFO, __METHOD__ . " fetching: " . $url);
        $content = file_get_contents($url, false, $stream_context);
        $result = json_decode($content, JSON_OBJECT_AS_ARRAY);
        return $result;
    }
static public function secureUrl($url, $params = []) {
        if (is_array($url)) {
            $url = implode("/", $url);
        }
        $headers = [
            "Authorization: Bearer " . JWT::getInternalToken()
        ];
        $opts = [
            "http" => [
                "method" => "GET",
                "header" => implode("\r\n", $headers)
            ],
            "ssl" => array(
                "verify_peer" => false,
                "verify_peer_name" => false,
            )
        ];
        $stream_context = stream_context_create($opts);
        if (count($params)) {
            $url = $url . "?" . http_build_query($params);
        }
        syslog(LOG_INFO, __METHOD__ . " fetching: " . $url);
        $content = file_get_contents($url, false, $stream_context);
        $result = json_decode($content, JSON_OBJECT_AS_ARRAY);
        return $result;
    }
static public function secureUrl ( $ url , $ params = [ ] ) { if ( is_array ( $ url ) ) { $ url = implode ( "/" , $ url ) ; } $ headers = [ "Authorization: Bearer " . JWT :: getInternalToken ( ) ] ; $ opts = [ "http" => [ "method" => "GET" , "header" => implode ( "\r\n" , $ headers ) ] , "ssl" => array ( "verify_peer" => false , "verify_peer_name" => false , ) ] ; $ stream_context = stream_context_create ( $ opts ) ; if ( count ( $ params ) ) { $ url = $ url . "?" . http_build_query ( $ params ) ; } syslog ( LOG_INFO , __METHOD__ . " fetching: " . $ url ) ; $ content = file_get_contents ( $ url , false , $ stream_context ) ; $ result = json_decode ( $ content , JSON_OBJECT_AS_ARRAY ) ; return $ result ; }
Fetching an url secured by the Internal accesstoken.
Should be using guzzle just like other Google Api stuff

@param $url
@param array $params
@return mixed
@throws \Exception
Fetching an url secured by the Internal accesstoken . Should be using guzzle just like other Google Api stuff