客户端可以使用hello.js向Facebook进行身份验证,然后将访问令牌发送回服务器,然后服务器执行get graph.facebook.com/me?access_token=xx
,如果正确,则返回用户的个人资料信息。
我想对Twitter做同样的事情,但是即使阅读了文档之后,我仍然不知道应该打哪个端点,是否可以通过REST调用来做到这一点?
您需要点击这个终点
https://dev.twitter.com/rest/reference/get/account/verify_credentials
这样(使用请求模块):
const oauth={
consumer_key:config.get('twitter.consumerKey'),
consumer_secret:config.get('twitter.consumerSecret'),
token:oauthToken,
token_secret:oauthTokenSecret
}
requestAsync({
url:'https://api.twitter.com/1.1/account/verify_credentials.json',
method:'GET',
oauth,
})
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句