Golang的Cookie操作

1,011 阅读1分钟

Golang的Cookie操作

打印Set-Cookie

func test() {
	res, _ := http.Get("http://www.xxx.com")
	defer res.Body.Close()
	for _, v := range res.Cookies() {
		fmt.Println(v)
	}
}