SaeTOAuthV2::get PHP Method

get() public method

GET wrappwer for oAuthRequest.
public get ( $url, $parameters = [] ) : mixed
return mixed
    function get($url, $parameters = array())
    {
        $response = $this->oAuthRequest($url, 'GET', $parameters);
        if ($this->format === 'json' && $this->decode_json) {
            return json_decode($response, true);
        }
        return $response;
    }

Usage Example

 public function get_fp($p = '')
 {
     //	$foo = $p->friends_timeline();
     $shop_oper = $this->SynchroOperator->find('first', array('conditions' => array('SynchroOperator.status' => 1)));
     $app_key = $shop_oper['SynchroOperator']['app_key'];
     $app_secret = $shop_oper['SynchroOperator']['app_secret'];
     $access_token = $shop_oper['SynchroOperator']['access_token'];
     $SaeTOAuthV2 = new SaeTOAuthV2($app_key, $app_secret, $access_token);
     $url = 'statuses/friends_timeline';
     $usparm['count'] = 50;
     $usparm['page'] = 1;
     $foo = $SaeTOAuthV2->get($url, $usparm);
     if (empty($foo) || isset($foo['error_code'])) {
         return false;
     }
     $friends_gp = array();
     if (isset($foo['statuses'])) {
         foreach ($foo['statuses'] as $k => $v) {
             $friends_gp[] = $v['user']['name'];
         }
     }
     return $friends_gp;
 }
All Usage Examples Of SaeTOAuthV2::get