RenrenRestApiService::rr_post_curl PHP Method

rr_post_curl() public method

POST wrapper,基于curl函数,需要支持curl函数才行
public rr_post_curl ( ) : mixed
return mixed
    public function rr_post_curl()
    {
        $args = func_get_args();
        $this->_currentMethod = trim($args[0]);
        #Method
        $this->paramsMerge($args[1])->getCallId()->setConfigToMapping()->generateSignature();
        #Invoke
        unset($args);
        return $this->_POST($this->_config->APIURL, $this->_params);
    }

Usage Example

Example #1
0
 public function update($text, $opt)
 {
     require_once 'renren/HttpRequestService.class.php';
     require_once 'renren/RenrenRestApiService.class.php';
     $refresh_uri = 'https://graph.renren.com/oauth/token?grant_type=refresh_token&refresh_token=' . $opt["oauth_token_secret"] . '&client_id=' . RENREN_KEY . '&client_secret=' . RENREN_SECRET;
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $refresh_uri);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     $result = curl_exec($ch);
     $res = json_decode($result);
     $access_token = $res->access_token;
     $refresh_token = $res->refresh_token;
     $config = new stdClass();
     $config->APIURL = 'http://api.renren.com/restserver.do';
     $config->APIKey = RENREN_KEY;
     $config->SecretKey = RENREN_SECRET;
     $config->APIVersion = '1.0';
     $config->decodeFormat = 'json';
     $GLOBALS['config'] =& $config;
     $rrObj = new RenrenRestApiService();
     $params = array('name' => getShort($opt["feed_content"], 30), 'description' => $opt["feed_content"], 'url' => $opt["feed_url"], 'image' => $opt["pic_url"], 'action_name' => $GLOBALS['ts']['site']['site_name'], 'action_link' => $opt["feed_url"], 'message' => '分享', 'access_token' => $access_token);
     $res = $rrObj->rr_post_curl('feed.publishFeed', $params);
     return true;
 }
All Usage Examples Of RenrenRestApiService::rr_post_curl