1
JSONObject obj = new JSONObject();

br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
obj.put("auth key", br.readLine());

System.out.println(obj.toString());

br.close();


return "test";

The problem I am having with this code is the json outputted is jibberish "{"auth key":""}" at first after reading through google I thought it was because it was being compressed with gzip however after checking the headers with fiddler there is no content encoding.

Any thoughts on the matter would be good many thanks

Siva Charan
  • 17,940
  • 9
  • 60
  • 95
zidsal
  • 577
  • 1
  • 7
  • 30
  • Are you trying to read from an SSL/TLS encrypted socket (HTTPS protocol) with a standard socket? – Filipe Palrinhas Jul 04 '12 at 17:26
  • no the site is standard http, I'm reading the site with javas .net httpURLConnection – zidsal Jul 04 '12 at 19:20
  • Are you shure the stream is not compressed with gzip or deflate? Can you check if Content-Type header is application/json? Or even better, can you show all the response answer headers? – Filipe Palrinhas Jul 04 '12 at 19:56

0 Answers0