Actually when I print using
                        InputStreamReader isr =  new 
InputStreamReader(socket.getInputStream(),"utf-8");
BufferedReader br = new BufferedReader(isr);
int b;
StringBuilder buf = new StringBuilder();
Log.d("Before while","whileeee");
 while ((b = br.read()) != -1) {
    buf.append((char) b);
    System.out.println("--------"+(char)b);
}
I see a blank line between the headers and the message. Please let me know 
how to get contents after this?

On Wednesday, October 24, 2012 9:09:23 AM UTC+3, Archana wrote:
>
> Hi, when I use that, 
>                                         StringWriter writer = new 
> StringWriter();
> IOUtils.copy(socket.getInputStream(),writer,HTTP.UTF_8);
> String string = writer.toString();
> Log.d("Writer value is : ",writer.toString());
> Nothing is getting printed in console. Can you provide an example link?
>
> On Wednesday, October 24, 2012 3:48:24 AM UTC+3, skink wrote:
>>
>>
>>
>> Archana wrote: 
>> > Hi, I did a HTTP Post from client. In server, I am able to see like, 
>> > POST /HTTP/ 1.1 
>> > Content Length: 41 
>> > Content-type: application/json 
>> > Host:10.0.2.15:5001 
>> > Connection: Keep Alive 
>> > 
>> > How do I retrieve the content of JSON using socket.getInputStream()? 
>> > 
>> > Any example/help is appreciated. Thanks in advance! 
>>
>> http://www.google.com/search?q=inputstream+to+string 
>>
>> pskink 
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to