예제 #1
0
 /**
  * 接口请求方法,具体接口都调用此方法进行请求
  * @param strin $api
  * @param array $params
  * @return string
  */
 public function doGet($api, array $params = array())
 {
     $res = HTTPClient::get($this->apiPrefix . $api, array_merge($params, array('access_token' => $this->accessToken)));
     if (false === $res) {
         $this->setError(-10, HTTPClient::getErrorMsg());
         return false;
     }
     return $res;
 }
예제 #2
0
 public function request($api, $params = array())
 {
     $res = \TimeCheer\Weixin\Util\HTTPClient::get($api, $params);
     if (false === $res) {
         $this->setError(-10, '接口请求失败!');
         return false;
     }
     return $res;
 }