nitantsoni / connspy

Golang http.Client for debugging

Home Page:https://medium.com/@j0hnsmith/eavesdrop-on-a-golang-http-client-c4dc49af9d5e

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

connspy

Tools for spying on connections, all output read/written to stderr

http package

A http.Client suitable for debugging, writes all http data to stdout.

client := connspy.NewClient(nil, nil)

resp, _ := client.Get("http://example.com/")
// ensure all of the body is read
ioutil.ReadAll(resp.Body)
resp.Body.Close()

resp, _ = client.Get("https://example.com/")
ioutil.ReadAll(resp.Body)
resp.Body.Close()

http output to stderr

net package

Provides a net.Conn wrapper that writes all reads/writes to stderr.

Docs

GoDoc

Background info

https://medium.com/@j0hnsmith/eavesdrop-on-a-golang-http-client-c4dc49af9d5e

About

Golang http.Client for debugging

https://medium.com/@j0hnsmith/eavesdrop-on-a-golang-http-client-c4dc49af9d5e

License:MIT License


Languages

Language:Go 100.0%