[android-developers] Dumping the results of DefaultHttpClient.execute()

2010-12-01 Thread Bret Foreman
I want to dump the results of DefaultHttpClient.execute() into the log
(just for debugging, not for all time). This methods returns an object
of class HttpResponse. This response is going into an XML pull parser
which is misbehaving so I'd like to see the raw XML. What method can I
call to get at this buffer before it goes into the parser? Ideally,
the buffer would not be consumed so that the pull parser would still
work when this debugging is turned on. Any pointers?

-- 
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


Re: [android-developers] Dumping the results of DefaultHttpClient.execute()

2010-12-01 Thread Kostya Vasilyev

Bret,

Kinds of depends on how you connect the http client and the parser.

If you're using getEntity().getContent() to get the stream, I'd think 
you could write a tee input stream (just like the unix tee command).


This stream class would read from the entity's stream, and return the 
data unchanged (consumed by the parser). While doing that, it would dump 
the data being read into logcat (or whatever).


This would provide what you're after - logging that does not interfere 
with data flow.


-- Kostya

01.12.2010 23:05, Bret Foreman пишет:

I want to dump the results of DefaultHttpClient.execute() into the log
(just for debugging, not for all time). This methods returns an object
of class HttpResponse. This response is going into an XML pull parser
which is misbehaving so I'd like to see the raw XML. What method can I
call to get at this buffer before it goes into the parser? Ideally,
the buffer would not be consumed so that the pull parser would still
work when this debugging is turned on. Any pointers?




--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
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


Re: [android-developers] Dumping the results of DefaultHttpClient.execute()

2010-12-01 Thread Frank Weiss
Seriously, can't you just dump the server's response with curl or wget on
your desktop or else use the debugger to see how the parser is misbehaving?

-- 
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