|
@@ -37,6 +37,7 @@ type Message struct {
|
|
StatusCode int
|
|
StatusCode int
|
|
Body []byte
|
|
Body []byte
|
|
Header http.Header
|
|
Header http.Header
|
|
|
|
+ Cookies []*http.Cookie
|
|
}
|
|
}
|
|
|
|
|
|
func header(w http.ResponseWriter, contentType string) {
|
|
func header(w http.ResponseWriter, contentType string) {
|
|
@@ -215,6 +216,7 @@ func Post(uri, certPath, keyPath string, header map[string]string, data io.Reade
|
|
}
|
|
}
|
|
defer res.Body.Close()
|
|
defer res.Body.Close()
|
|
msg, err = readBody(res)
|
|
msg, err = readBody(res)
|
|
|
|
+ msg.Cookies = res.Cookies()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
@@ -227,6 +229,7 @@ func Get(uri, certPath, keyPath string, header map[string]string) (msg Message,
|
|
|
|
|
|
defer res.Body.Close()
|
|
defer res.Body.Close()
|
|
msg, err = readBody(res)
|
|
msg, err = readBody(res)
|
|
|
|
+ msg.Cookies = res.Cookies()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|