Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

go-harlog Go Documentation CircleCI

net/http client logging by HAR format.

Take http request/response log by HAR (HTTP Archive) format. It can visualize by any tools.

How to use

$ go get github.com/vvakame/go-harlog
har := &harlog.Transport{}
hc := &http.Client{
    Transport: har,
}

// do something...

b, err := json.MarshalIndent(har.HAR(), "", "  ")
if err != nil {
    return err
}
fmt.Println(string(b))

See HAR file in Google Chrome DevTools.

This screenshots are generated by this library. Capture the log about Google Cloud Storage access by cloud.google.com/go/storage.

Headers

Response

Timing

Limitations

  • compressed response is not supported yet.
  • headersSize is not calculated.

patches welcome!

About

net/http client logging by HAR format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published