对于本地主机上的twitter,我有一些困难。
我使用的是正式的Yii2 authclient扩展-- Yii2 2-授权客户端并遵循本教程。
一切看起来都很好,但当我试图打电话时:
$twitter->api('search/tweets.json?q=%40twitterapi', 'GET');我有以下例外:
Request failed with code: 401, message: {"errors":[{"code":32,"message":"Could not authenticate you."}]}我的推特应用键是它应该是的。
在回调url的应用程序页面中,我已经尝试了以下url,但没有成功:
http://local-project.dev
http://localhost/project_folder/frontend/web/
http://127.0.0.1/project_folder/frontend/web/
http://127.0.0.1:80/project_folder/frontend/web/有什么想法我错了吗?
发布于 2015-12-03 13:40:10
这似乎是yii2扩展url解析器- https://github.com/yiisoft/yii2/issues/7224的一个问题。
使用数组格式就像一种魅力:
$twitter->api('search/tweets.json', 'GET', ['q' => 'twitterapi']);https://stackoverflow.com/questions/34064284
复制相似问题