Header golang client get
Usually how to tech is
`
req, err := http.NewRequest("GET", "http://example.com", nil)
req.Header.Add("Authorize", "dswxswsxw")
resp, err := client.Do(req)
`
BUT Have problem inside. So…. use this
`
headers := http.Header{
"Accept-Encoding": []string{"gzip, deflate"},
}
req, err := http.NewRequest("GET", url, nil)
req.Header = headers
client := &http.Client{}
resp, err = client.Do(req)
`
More Safe.