gobuch/microservices/http-client-config/main.go

18 lines
267 B
Go
Raw Permalink Normal View History

2020-08-21 04:26:40 +00:00
package main
import (
"net/http"
"time"
)
func main() {
client := http.Client{Transport: &http.Transport{
ResponseHeaderTimeout: 1 * time.Millisecond,
}}
res, err := client.Get("https://google.com")
if err != nil {
panic(err)
}
defer res.Body.Close()
}