obtenir le corps de réponse de HttpResponse

J'ai fait ceci:

response = httpclient.execute(targetHost, httppost); 
    if(response.getStatusLine().getStatusCode() == 200)
                        {
    HttpEntity entity = response.getEntity();
    System.out.println("Entity:"+entity);
  if (entity != null) 
                            {
        String responseBody = EntityUtils.toString(entity);
        System.out.println("finalResult"+responseBody.toString());
                            }

La chose, c'est que la première println() affiche ceci: org.apache.http.conn.BasicManagedEntity@481e8150 qui est bon.

Mais la deuxième System.out.println("finalResult"+responseBody.toString()); affiche uniquement ce finalResult. Alors, quel est le problème avec ce:

String responseBody = EntityUtils.toString(entity);
            System.out.println("finalResult"+responseBody.toString());

???

IMPORTANT Ce HttpEntity entity = response.getEntity(); est égal à org.apache.http.conn.BasicManagedEntity@481e8150. DONC, le problème doit être ici:

Chaîne responseBody = EntityUtils.toString(entité);.

S'il vous plaît aider!!!

source d'informationauteur adrian