优化代码

This commit is contained in:
GoEdgeLab
2021-08-07 16:27:42 +08:00
parent a709b64c81
commit 1dc8c23e3b
4 changed files with 37 additions and 10 deletions

View File

@@ -16,6 +16,9 @@ var timeoutClientLocker = sync.Mutex{}
// 导出响应
func DumpResponse(resp *http.Response) (header []byte, body []byte, err error) {
header, err = httputil.DumpResponse(resp, false)
if err != nil {
return
}
body, err = ioutil.ReadAll(resp.Body)
return
}