Skip to content

Instantly share code, notes, and snippets.

@cipepser
Last active January 21, 2018 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cipepser/7caf464c7d3ae16e18d7c80f9aacf969 to your computer and use it in GitHub Desktop.
Save cipepser/7caf464c7d3ae16e18d7c80f9aacf969 to your computer and use it in GitHub Desktop.
c := &http.Client{}
req, err := http.NewRequest("GET", URL, nil)
if err != nil {
panic(err)
}
resp, err := c.Do(req)
if err != nil {
panic(err)
}
b, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(b))
@cipepser
Copy link
Author

curl感覚で手軽にHTTP GETする

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment