mirror of
https://github.com/SourceFellows/gobuch.git
synced 2025-08-03 13:12:16 +02:00
initial import
This commit is contained in:
18
microservices/http-client/main.go
Normal file
18
microservices/http-client/main.go
Normal file
@ -0,0 +1,18 @@
|
||||
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))
|
||||
}
|
Reference in New Issue
Block a user