我正在开发一个项目,涉及抓取 Twitter 数据信息、解析它并将其显示在我们的网站上以用于管理目的。我们还在研究通过与 Twitter REST API 联锁的 Web 界面发布推文或更新,但首先,我想做简单的 GET。我正在尝试通过 dev.twitter.com 上的 API 文档执行我的 home_timeline 之一,但我在数据响应中收到 400 Bad Request 错误。这是我用来执行 GET 的 ColdFusion 代码(为了安全起见,删除了实际代码):
<cfhttp url="https://api.twitter.com/1.1/statuses/home_timeline.json" method="get" result="thisGet">
<cfheader name="oauth_consumer_key" value="*ConsumerKeyCode*">
<cfheader name="oauth_nonce" value="*NonceCode*">
<cfheader name="oauth_signature" value="*SignatureCode*">
<cfheader name="oauth_signature_method" value="HMAC-SHA1">
<cfheader name="oauth_timestamp" value="1349816229">
<cfheader name="oauth_token" value="*TokenCode*">
<cfheader name="oauth_version" value="1.0">
<cfhttpparam name="username" value="*TwitterUserName*" type="formfield">
<cfhttpparam name="password" value="*TwitterPassword*" type="formfield">
</cfhttp>
谁能告诉我我在这里做错了什么?谢谢!
更新:将 home.timeline 更改为 home_timeline。
最佳答案
我对 Twitter API 一无所知,但通过 2 分钟的谷歌搜索,我看到很多对 home_timeline
的引用,但没有看到 home.timeline
的引用。你确定你没看错吗?
关于api - ColdFusion Twitter API 错误请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12809057/