Skip to content

Instantly share code, notes, and snippets.

@ara-ta3
Created October 14, 2014 11:29
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 ara-ta3/8ece4f73e573f7c0abab to your computer and use it in GitHub Desktop.
Save ara-ta3/8ece4f73e573f7c0abab to your computer and use it in GitHub Desktop.
golangでhttp get request
package main
import (
"io/ioutil"
"net/http"
)
func main() {
response, _ := http.Get("http://google.com")
body, _ := ioutil.ReadAll(response.Body)
defer response.Body.Close()
println(string(body))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment