本文整理汇总了PHP中TwitterAPIExchange::request方法的典型用法代码示例。如果您正苦于以下问题:PHP TwitterAPIExchange::request方法的具体用法?PHP TwitterAPIExchange::request怎么用?PHP TwitterAPIExchange::request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TwitterAPIExchange
的用法示例。
在下文中一共展示了TwitterAPIExchange::request方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testIssue70
/**
* Apparently users/lookup was not working with a POST
*
* @see https://github.com/J7mbo/twitter-api-php/issues/70
*/
public function testIssue70()
{
$url = 'https://api.twitter.com/1.1/users/lookup.json';
$method = 'POST';
$params = array('screen_name' => 'lifehacker');
$data = $this->exchange->request($url, $method, $params);
$this->assertContains('created_at', $data);
}
示例2: testAdditionalCurlOptions
/**
* Test to check that options passed to curl do not cause any issues
*/
public function testAdditionalCurlOptions()
{
$url = 'https://api.twitter.com/1.1/search/tweets.json';
$method = 'GET';
$params = '?q=#twitter';
$data = $this->exchange->request($url, $method, $params, array(CURLOPT_ENCODING => ''));
$data = (array)@json_decode($data, true);
$this->assertNotCount(1, $data);
}