我希望能够从ruby的Net :: HTTP for https获取完整的HTTP跟踪。目前我正在检查调试器中的内容,如下所示:
(rdb:1) response
#<Net::HTTPFound 302 FOUND readbody=true>
(rdb:1) response.each_header {|x| puts x}
content-type
date
location
server
vary
content-length
connection
{"content-type"=>["text/html; charset=utf-8"], "date"=>["Wed, 28 Aug 2013 16:13:44 GMT"], "location"=>["https://example.com/login?next=/stuff"], "server"=>["nginx/1.1.19"], "vary"=>["Cookie"], "content-length"=>["0"], "connection"=>["keep-alive"]}
这真的很有帮助,但我只是喜欢看原始HTTP,例如
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
等
有没有办法只转储HTTP请求和响应的副本而不经过中间处理来重构它们?
非常感谢提前