Skip to content

Instantly share code, notes, and snippets.

@WinstonN
Created October 18, 2014 10:43
Show Gist options
  • Save WinstonN/fce9a9926759027df64b to your computer and use it in GitHub Desktop.
Save WinstonN/fce9a9926759027df64b to your computer and use it in GitHub Desktop.
func connect() {
var url string = "http://domain.com/json"
client := &http.Client{}
req, err := http.NewRequest("GET", url, nil)
req.Header.Set("User-Agent", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)")
resp, err := client.Do(req)
if err != nil {
// handle error
}
log.Println(resp)
return resp
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment