close
client := http.Client{}
request, _ := http.NewRequest("Get", "http://localhost:8080/test", nil)
request.Header.Add("Content-Type", "application/json")
dump, _ := httputil.DumpRequestOut(request, true)
log.Println("resp dump: ", string(dump))
resp, err := client.Do(request)
if err == nil {
dump, _ := httputil.DumpResponse(resp, true)
log.Println("resp dump: ", string(dump))
}
http://speakmy.name/2014/07/29/http-request-debugging-in-go/
全站熱搜
留言列表