I want to get private headers (RateLimit, etc.) sent from Twitter via TwistOAuth

Asked 2 years ago, Updated 2 years ago, 134 views

I would like to take the RateLimit in the response header when I get/POST on TwitterAPI. For example, the result returned by get() is beautifully shaped as an object.

/**
 * Execute GET request.
 *
 * @param string $url full or partial endpoint URL.
 *                         e.g. "status/show", "https://api.twitter.com/1.1/statuses/show.json"
 * @param mixed [$params] 1-democratic array or query string.
 * @param string [$proxy] full proxy URL.
 *                         e.g. https://111.222.333.444:8080
 * @return mixed
 * @throws TwistException
 */
public function get($url,$params=array(),$proxy='){
    $ch = $this-> curlGet($url, $params, $proxy);
    $response=curl_exec($ch);
    return self::decode($ch,$response);
}

Should I use TwistOAuth::curlGet() and TwistOAuth::decode() instead of get()?
But decode() is private, so you cannot access it from the outside.

I'm sorry, but I'm a beginner on the web itself, so I might be misguided things.
(You can remove it without modifying the cord, etc.)

I apologize for the inconvenience, but please let me know.

php twitter oauth

2022-09-30 19:23

1 Answers

curl_exec() also needs to be done, but as you can imagine, you might want to modify TwistOAuth::get().

You may want to consult with the author on Github or Twitter.


2022-09-30 19:23

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.