Closed suntsh closed 10 years ago
c. WithHeader("User-Agent", "Super Robot"). WithHeader("custom-header", "value"). WithHeaders(map[string]string { "another-header": "another-value", "and-another-header": "another-value", }). WithOption(httpclent.OPT_TIMEOUT, 60). WithCookie(&http.Cookie{ Name: "uid", Value: "123", }). Get("http://github.com", nil) 上面添加的header和cookie是只对 Get("http://github.com", nil)这一次请求有效,还是对后面的请求都有效呢?
Cookie设置后是一直有效的,header是一次有效的
Header默认值已经支持
c. WithHeader("User-Agent", "Super Robot"). WithHeader("custom-header", "value"). WithHeaders(map[string]string { "another-header": "another-value", "and-another-header": "another-value", }). WithOption(httpclent.OPT_TIMEOUT, 60). WithCookie(&http.Cookie{ Name: "uid", Value: "123", }). Get("http://github.com", nil) 上面添加的header和cookie是只对 Get("http://github.com", nil)这一次请求有效,还是对后面的请求都有效呢?