Not getting full http response in android -
i try json data ulr .
i testing url in firefox poster add-on work fine ,getting full response .
but in android not getting full http response .
this code
httpclient client = new defaulthttpclient(); httpconnectionparams.setconnectiontimeout(client.getparams(), 10000); // timeout // limit httpresponse response; jsonobject json = new jsonobject(); try { httppost post = new httppost(api.all_property_buy); /* * json.put("fid", fname); json.put("fid", lname); */ stringentity se = new stringentity(json.tostring()); se.setcontenttype(new basicheader(http.content_type,"application/json")); post.setentity(se); response = client.execute(post); /* checking response */ if (response != null) { inputstream in = response.getentity().getcontent(); // // data in // // entity // system.out.println("response is:"+ in.tostring()); inputstreamreader isr = new inputstreamreader(in); bufferedreader br = new bufferedreader(isr); string s = new string(); temps = new string(); while ((s = br.readline()) != null) { system.out.println("response :" + s); } } } catch (exception e) { e.printstacktrace(); }
i search google , try code not solve problem.
please 1 me.
try this...
stringbuffer stringbuffer = new stringbuffer(); while ((s = br.readline()) != null) { stringbuffer.append(s); } system.out.println("response :" + stringbuffer);
sometimes not print full response on console full response in variable...
solution : full data not shown on logcat or console
Comments
Post a Comment