Je suis en train d'obtenir mes contacts de Windows Live en utilisant RestEasyEn utilisant RestEasy avec Windows Live Service, comment annuler la liste des contacts?
Après avoir authentifié avec succès mon utilisateur, je l'ai fait l'appel à https://livecontacts.services.live.com/users/@[email protected]/repos/Livecontacts Définissez l'en-tête d'authentification, a ajouté mon identifiant et mes jetons
Si je fais l'appel de la ligne de commande en utilisant cURL-je obtenir le résultat attendu, mais dans mon application Web Je reviens du charabia
par exemple ??
... {[?? e^7E ...
classe d'interface actuelle est le test
public interface WindowsLiveAPI {
@GET
@Path(value="/@[email protected]{liveId}/rest/livecontacts")
Response getContacts(@PathParam("liveId") @Encoded String liveId, @HeaderParam("Authorization") String delegatedToken);
}
JETABLE:
ResteasyProviderFactory.getInstance().addMessageBodyReader(DefaultTextPlain.class);
RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
WindowsLiveAPI client = ProxyFactory.create(WindowsLiveAPI.class, "https://livecontacts.services.live.com");
ClientResponse<LiveContacts> response = (ClientResponse) client.getContacts(LIVE_ID, DELEGATED_TOKEN);
System.out.println(response.getStatus()); //Produces 200 (401 after token expires)
System.out.println(response.getEntity(String.class)); //produces gibberish
Quelqu'un at-il la moindre idée comment annuler la réponse