Exemple #1
0
 /**
  * Makes a request
  * @param string $url A URL in which to make a GET request
  * @param Array $params An associative array of key/value pairs to pass to said URL
  * @access private
  * @return Response
  */
 private function GetResponse($method = 'GET')
 {
     //-- since there's no option to use anything other curl, this check is kinda useless
     //-- I had high hopes with this one using sockets and whatnot, but alas, time is of
     //-- the essence... in internet time
     if ($this->useCurl) {
         $response = new Response();
         $http = WebRequest::Instance();
         $res = $http->Create($this->url, $method, $this->parameters);
         if ($res instanceof Error) {
             return $res;
         }
         $response->info = $res->Info;
         $response->json = $res->Content;
         $response = Response::Create($this, &$response);
         return $response;
     }
 }
 public function __construct($key)
 {
     $this->key = $key;
     $this->request = WebRequest::Instance();
 }