mirror of
https://gitee.com/johng/gf
synced 2026-06-26 17:35:40 +08:00
19 lines
303 B
Go
19 lines
303 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gogf/gf/net/ghttp"
|
|
"github.com/gogf/gf/os/glog"
|
|
)
|
|
|
|
func main() {
|
|
c := ghttp.NewClient()
|
|
c.SetHeader("Cookie", "name=john; score=100")
|
|
if r, e := c.Get("http://127.0.0.1:8199/"); e != nil {
|
|
glog.Error(e)
|
|
} else {
|
|
fmt.Println(string(r.ReadAll()))
|
|
}
|
|
}
|