0
    HttpClient client = new DefaultHttpClient();
    HttpGet request = new HttpGet();
    request.setURI(new URI(address));
    HttpResponse response = client.execute(request);
    BufferedReader in = new BufferedReader(new 
InputStreamReader(response.getEntity().getContent()));

When I retrieve information like that, bufferedreader in contains only one long line with the whole text. It doesn't divide break data into lines. As a result, only first 3 kwords are fit into the line and the rest is losed. How can I avoid this problem?

2 Answers 2

1

Simply

URL url = new URI(address).toURL();
InputStream is = url.openStream();
Sign up to request clarification or add additional context in comments.

Comments

0

Have you try this?

String data = EntityUtils.toString(response.getEntity());

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.