gobuch/microservices/http-client/main.go

19 lines
266 B
Go
Raw Normal View History

2020-08-21 04:26:40 +00:00
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
res, err := http.Get("https://google.com")
if err != nil {
panic(err)
}
defer res.Body.Close()
fmt.Println(res.Status)
bites, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(bites))
}