Igo*_*lva 2 php twitter stream websocket
我无法打开与Twitter Stream API的连接.无论我尝试什么,我能得到的唯一回应是401 Unauthorized.
我已经进行了各种测试,甚至使用了我在GitHub上找到的一些库.
即使在我的代码之外,使用cURL,我也无法使其工作.
$oauth = array(
'oauth_consumer_key' => $this->m_oauth_consumer_key,
'oauth_nonce' => time(),
'oauth_signature_method' => 'HMAC-SHA1',
'oauth_token' => $this->m_oauth_token,
'oauth_timestamp' => time(),
'oauth_version' => '1.0'
);
$base_info = $this->buildBaseString($this->url, 'GET', $oauth);
$composite_key = rawurlencode($this->m_oauth_consumer_secret) . '&' . rawurlencode($this->m_oauth_token_secret);
$oauth_signature = base64_encode(hash_hmac('sha1', $base_info, $composite_key, true));
$oauth['oauth_signature'] = $oauth_signature;
$header = $this->buildAuthorizationHeader($oauth);
Run Code Online (Sandbox Code Playgroud)
这是我构建HTTP请求标头和签名的代码.我尝试了很多不同的方法,没有成功.
Anoyone有什么想法可以帮助我吗?
先感谢您.
| 归档时间: |
|
| 查看次数: |
2404 次 |
| 最近记录: |