Golang发送http GET请求的示例代码

上传:cecily16736 浏览: 24 推荐: 0 文件:PDF 大小:25KB 上传时间:2021-02-01 17:52:42 版权申诉
使用标准库http来实现 package tools import ( io/ioutil net/http ) func Get(url string)string{ res, err :=http.Get(url) if err != nil { return } robots, err := ioutil.ReadAll(res.Body) res.Body.Close() if err != nil { return } return string(robots) } 以上就是Golang发送http GET请求的示例代码的详细内容,更
上传资源
用户评论