Closed suntsh closed 10 years ago
res, _ := c. WithHeader("Accept-Language", "en-us"). WithCookie(&http.Cookie{ Name: "name", Value: "github", }). WithHeader("Referer", "http://www.baidu.com"). Get(SERVER, nil)
fmt.Println(c.Headers)
添加header不成功啊,例子程序里面,你在最后打印c.headers 是空的
Headers是存放默认Header的,WithHeader不会改变这个值
WithHeader
res, _ := c. WithHeader("Accept-Language", "en-us"). WithCookie(&http.Cookie{ Name: "name", Value: "github", }). WithHeader("Referer", "http://www.baidu.com"). Get(SERVER, nil)
fmt.Println(c.Headers)
添加header不成功啊,例子程序里面,你在最后打印c.headers 是空的