Use the standard library http to implement
package tools import ( "io/ioutil" "net/http" ) func Get(url string)string{ res, err :=(url) if err != nil { return "" } robots, err := () () if err != nil { return "" } return string(robots) }
The above is the detailed content of the sample code for Golang to send http GET request. For more information about Golang to send http GET request, please follow my other related articles!