示例#1
0
 /**
  * @param string $host
  * @param string $resource
  * @return string
  *   Return the response body from the HTTP request
  */
 public function doRequest($host, $resource)
 {
     if (!($cookieJar = $this->cache->fetch('wesnick.ringcentral.cookies'))) {
         $cookieJar = new CookieJar();
     }
     $client = new FileGetContents($cookieJar);
     $request = new Request(Request::METHOD_GET, $resource, $host);
     $response = new Response();
     $client->setVerifyPeer(false);
     $client->send($request, $response);
     $this->cache->save('wesnick.ringcentral.cookies', $client->getCookieJar());
     return $response->getContent();
 }