httpcli is better choice for http request.
implements a friendly API for net/http standard library.
- simpler Get、Post request
- decorate function param settings
req := httpcli.Get("https://www.google.com").WithTLS()
response, err := req.Response()
if err != nil {
fmt.Println("err:", err)
} else {
fmt.Println("result:",response.String())
}
req := Post("https://baidu.com").WithTLS().
WithParam("wd", "查询")
response, err := req.Response()
if err != nil {
fmt.Println("err:", err)
} else {
fmt.Println("result:",response.String())
}