diff options
Diffstat (limited to 'extras/hs-test/infra/utils.go')
-rw-r--r-- | extras/hs-test/infra/utils.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/extras/hs-test/infra/utils.go b/extras/hs-test/infra/utils.go index 9619efbbf63..05b7b365487 100644 --- a/extras/hs-test/infra/utils.go +++ b/extras/hs-test/infra/utils.go @@ -5,6 +5,7 @@ import ( "io" "net" "net/http" + "net/http/httputil" "os" "strings" "time" @@ -96,6 +97,14 @@ func NewHttpClient() *http.Client { return client } +func DumpHttpResp(resp *http.Response, body bool) string { + dump, err := httputil.DumpResponse(resp, body) + if err != nil { + return "" + } + return string(dump) +} + func TcpSendReceive(address, data string) (string, error) { conn, err := net.DialTimeout("tcp", address, time.Second*30) if err != nil { |