Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 579 Bytes

README.md

File metadata and controls

29 lines (23 loc) · 579 Bytes

gowirelog

Simple wire logging utils targeted to http.Client

package main

import (
  "net/http"

  "github.com/jpfielding/gowirelog/wirelog"
}

func main() {
	transport := wirelog.NewHTTPTransport()
	logname := "/tmp/logs/http.log"
	closer, err := wirelog.LogToFile(transport, logname, true, true)
  	defer closer.Close()
	client := &http.Client{
		Transport: transport,
	}
	client.Jar, _ = cookiejar.New(nil)
	login, _ := url.Parse(login)
	req, _ := http.NewRequest("GET", login.String(), nil)
	resp, _ := ctxhttp.Do(ctx, client, req1)
	defer resp.Body.Close()
}