当我将参数传递给 Twitter API 时,我收到“无法使用 OAuth 进行身份验证”错误。如果我不传递任何参数,那么它工作正常。
任何人都可以研究这个问题并为我提供解决方案。
我的 OAuth 请求数组如下
Array
(
[method] => GET
[uri] => Array
(
[host] => api.twitter.com
[path] => 1/direct_messages.json
)
[auth] => Array
(
[method] => OAuth
[oauth_token] => 605267577-YwEtkLXgDZcXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[oauth_token_secret] => p2SKUjaRz7oUqW8jmXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[oauth_consumer_key] => PAu4LlcETXXXXXXXXXXXXX
[oauth_consumer_secret] => OA2ISmIYMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
)
[body] => Array
(
[count] => 200
)
[header] => Array
(
[Authorization] => OAuth oauth_version="1.0",oauth_signature_method="HMAC-SHA1",oauth_token="605267577-YwEtkLXgDZcLaFIZHdJxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",oauth_consumer_key="PAu4LlcETSxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",oauth_nonce="616caa42455f6a490f7fce089fdb56b5",oauth_timestamp="1342592116",oauth_signature="B2Dr4CioXL55fwxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
)
)
我传递了“count”参数,这是我得到的响应
Array
(
[error] => Could not authenticate with OAuth.
[request] => /1/direct_messages.json
)
提前致谢, Intekhab