Closed Shenglian closed 5 years ago
get func httpGet() { resp. err := http.Get("url", strings.NewReader("name=cjb")) if err != nil { // handler error }
get
func httpGet() { resp. err := http.Get("url", strings.NewReader("name=cjb")) if err != nil { // handler error }
defer resp.Body.Colse()
body, err := ioutil.ReadAll(resp.Body) if err != nil { // handler error }
fmt.Println(string(body)) }
defer resp.Body.Colse()
body, err := ioutil.ReadAll(resp.Body) if err != nil { // handler error }
fmt.Println(string(body)) }