当我将它与 GET 一起使用时,这不会发生。
IE
这不起作用:
ProxyAuthenticator pa = new ProxyAuthenticator();
Authenticator.setDefault( pa );
OAuthService service = new ServiceBuilder().provider( TwitterApi.class ).apiKey( strAPIKey ).apiSecret( strAPISecret ).build();
Token requestToken = service.getRequestToken();
Scanner in = new Scanner( System.in );
Verifier verifier = new Verifier(in.nextLine());
String url = "http://api.twitter.com/1/statuses/update.json?status=helllllooooo";
OAuthRequest request = new OAuthRequest( Verb.POST, url );
service.signRequest( accessToken , request2 );
final Response response = request.send();
响应返回 401。但是,使用带有上述代码的 GET 会返回 200 作为响应。IE
url = "http://api.twitter.com/1/account/verify_credentials.json";
OAuthRequest request = new OAuthRequest( Verb.GET, url );
service.signRequest( accessToken, request );
Response resp = request.send();
有什么想法我应该做什么?