0

Hi,

I have the following method to open a URL API

String c="";
  URL direccionURL;
  try {
   direccionURL = new URL("http://api.stackoverflow.com/1.0/users/523725");
   BufferedReader in = new BufferedReader(new InputStreamReader(
     direccionURL.openStream()));

   String inputLine;

   while ((inputLine = in.readLine()) != null)
    c+=inputLine;

   in.close();
  } catch (MalformedURLException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
  return c;

In the end, the "c" variable contains a set of characters that are not the same I get if I open the same URL with a browser. Why?, What am I doing wrong?

Thank's for help.

Regards!

1 Answer 1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .