request1 [Golang] http request 보내는 법 [Golang] http request 보내는 법 Go에서는 'net/http'패키지를 사용하여 HTTP 요청을 할 수 있습니다. GET 다음은 URL에 GET 요청을 하고 응답을 인쇄하는 방법에 대한 간단한 예입니다. package main import ( "fmt" "io/ioutil" "net/http" ) func main() { resp, err := http.Get("https://www.example.com") if err != nil { fmt.Println(err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Println(err) return } fmt.Println(.. Golang 2023. 2. 11. 이전 1 다음 💲 추천 글