Created
October 18, 2014 10:43
-
-
Save WinstonN/fce9a9926759027df64b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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