如何通过 twitter api 发布推文?
我已将 twitter api 集成到我的应用程序中。在我的应用程序中,我通过使用 oauth 库获得了 oauth_token 和 oauth_secre_key 。现在我想发布一条新推文。我如何发送带有授权标头的 http 请求。我的问题是我有一个从 twitter api 发送消息的网址,即:-https://api.twitter.com/1/statuses/update.json?status=Maybe%20he%27ll%20finally%20find%20his% 20keys.%20%23peterfalk&trim_user=true&include_entities=true 但是当我打开浏览器时我收到此错误:-
{“错误”:“无法验证您的身份。”,“请求”:“/1/statuses/update.json?status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk& ;trim_user=true&include_entities=true"}
修复此错误的方法是什么?如何在我的请求中添加授权标头?
预先感谢...
I have integrate twitter api in my application. In my application i have got oauth_token and oauth_secre_key by using oauth library. NOw i want to post a new tweet. How i send my http request with authorization header. my problem is that i have a url for send message from twitter api that is :-https://api.twitter.com/1/statuses/update.json?status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk&trim_user=true&include_entities=true but when i open i browser then i got this error:-
{"error":"Could not authenticate you.","request":"/1/statuses/update.json?status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk&trim_user=true&include_entities=true"}
What is the way to fix this error? How i add authorization header with my request?
Thanks in advances...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我收到此错误是因为我没有以正确的格式设置参数。现在我使用这段代码并且工作正常。
I get this error because i have not set parameter in proper format. Now i use this code and working fine.