tags:

views:

188

answers:

1

Hi,

I am trying to accomplish the task of

Making a Wed request ->getting result in JSON format ->Parsing the result -> and finally display the result in a table....

Any help regarding any of the task is welcome....

+2  A: 

I'll leave you to display the results, but the first bit can be accomplished as follows:

URLConnection connection = new URL("http://example.com/someService.jsp").openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()), 1024 * 16);
StringBuffer builder = new StringBuffer();
String line;
while ((line = reader.readLine()) != null) {
  builder.append(line).append("\n");
}
JSONObject object = new JSONObject(builder.toString()); 
Jim Blackler