Groups
Groups
Sign in
Groups
Groups
golang-nuts
Conversations
About
Send feedback
Help
Dump ResponseWriter
370 views
Skip to first unread message
bsr
unread,
Oct 28, 2012, 7:36:17 PM
10/28/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
http://golang.org/src/pkg/net/http/httputil/dump.go?s=4255:4326#L138
works great for dump request.
not sure how to use httputil .DumpResponse without affecting the buffer.
Thanks.
Nigel Tao
unread,
Oct 28, 2012, 7:56:08 PM
10/28/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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 PM
10/28/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golan...@googlegroups.com, bsr
Thanks Nigel.
Reply all
Reply to author
Forward
0 new messages