title: Parsing a JSON Array from HTTP Response in Java
body: <p>I am using the HTTP client from Apache, and am trying to parse a JSON array from the response I get from the client.</p>
  
  <p>This is an example of the JSON I receive back.</p>
  
  <pre><code> [{"created_at":"2013-04-02T23:07:32Z","id":1,"password_digest":"$2a$10$kTITRarwKawgabFVDJMJUO/qxNJQD7YawClND.Hp0KjPTLlZfo3oy","updated_at":"2013-04-02T23:07:32Z","username":"eric"},{"created_at":"2013-04-03T01:26:51Z","id":2,"password_digest":"$2a$10$1IE6hR4q5jQrYBtyxMJJBOGwSPQpg6m5.McNDiSIETBq4BC3nUnj2","updated_at":"2013-04-03T01:26:51Z","username":"Sean"}]
  </code></pre>
  
  <p>I am using <a href="http://code.google.com/p/json-simple/" rel="nofollow">http://code.google.com/p/json-simple/</a> as my json library. </p>
  
  <pre><code>        HttpPost httppost = new HttpPost("SERVERURL");
          httppost.setEntity(input);
          HttpResponse response = httpclient.execute(httppost);
          BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()))
  
          Object obj=JSONValue.parse(rd.toString());
          JSONArray finalResult=(JSONArray)obj;
          System.out.println(finalResult);
  </code></pre>
  
  <p>Here is the code I have tried but it doesn't work. I am not really sure what to do. Any help is appreciated, thanks.</p>