我使用Oauth连接到Twitter,但会导致401错误。我在这里做错了什么?Twitter和Oauth导致401错误
//config
define('CONSUMER_KEY',"");
define('CONSUMER_SECRET',"");
define('OAUTH_TOKEN',"1U");
define('OAUTH_TOKEN_SECRET',"");
require_once('twitteroauth/twitteroauth.php');
$connection = new TwitterOAuth (CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET);
$connection->post('statuses/update', array('status' => 'testing'));
$httpc = $connection->http_code;
if($httpc == 200) {
echo 'succesvol';
} else {
echo $httpc;
}
Twitter返回什么错误信息? – abraham