Dump ResponseWriter

370 views
Skip to first unread message

bsr

unread,
Oct 28, 2012, 7:36:17 PM10/28/12
to golan...@googlegroups.com
For debugging, how can I dump response(writer) just before sent the response out.

For example, dump the response where the comments indicate. http://play.golang.org/p/kWJ9WwCpLx

not sure how to use httputil .DumpResponse without affecting the buffer.

Thanks.

Nigel Tao

unread,
Oct 28, 2012, 7:56:08 PM10/28/12
to bsr, golan...@googlegroups.com
If you just want the payload, try something like
http://play.golang.org/p/dKcOKTZZ1r

If you want the headers as well, try something like
http://play.golang.org/p/fm98PS72SQ

bsr

unread,
Oct 28, 2012, 8:19:57 PM10/28/12
to golan...@googlegroups.com, bsr
Thanks Nigel.
Reply all
Reply to author
Forward
0 new messages