2012-07-16 4 views
8

Aquí está mi código para enviar y enviar un mensaje directo usando Scribe. Pero me da una respuesta nula. ¿Qué estoy haciendo mal?Twitter: envíe un mensaje directo con el escriba

OAuthRequest req; 
OAuthService s; 
s = new ServiceBuilder() 
     .provider(TwitterApi.class) 
     .apiKey(APIKEY) 
     .apiSecret(APISECRET) 
     .callback(CALLBACK) 
     .build(); 
req = new OAuthRequest(Verb.POST, "https://api.twitter.com/1/direct_messages/new.format?user_id="+user_id+"&text=my app test"); 

s.signRequest(MyTwitteraccesToken, req); 
Response response = req.send(); 

    if (response.getBody() != null) { 
    String t=response.getBody(); 
    Log.w("twittersent","twittersent"+t); 
} 

¿Alguien me puede ayudar?

+0

debe reemplazar el "formato" a "xml" o "json" en su url de solicitud – Cauliturtle

+0

@Cauliturtle lo intenté ... pero el mismo resultado. – hacker

+0

entonces intente codificar el texto? – Cauliturtle

Respuesta

0

Intente especificar el formato como XML o JSON en su URL de solicitud. Además, asegúrese de que todo el archivo de texto tenga codificación URL.

Cuestiones relacionadas