1 package main
2
3 import(
4 "fmt"
5 "net/http"
6 "io/IoUtil"
7 )
8 func main(){
9
10 response,_:=http.Get("www.//127.0.0.1.com")
11 defer response.Body.Close()
12 body,_:=IoUtil.ReadAll(response.Body)
13 fmt.Println(string(body))
14
15 if response.StatusCode == 200 {
16 fmt.Println("ok")
17
18 }else{
19 fmt.Println("error")
20
21 }
22 }