From a11899cbef7d87fd0b61c7b6e51447e858c4e899 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期五, 20 十二月 2019 16:24:56 +0800 Subject: [PATCH] add log --- extend/esutil/EsClient.go | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/extend/esutil/EsClient.go b/extend/esutil/EsClient.go index bd8a28f..0fb6e16 100644 --- a/extend/esutil/EsClient.go +++ b/extend/esutil/EsClient.go @@ -303,3 +303,18 @@ } return sources, nil } + + +func HttpGet(str string) ([]byte){ + resp, err := http.Get(str) + if err != nil { + // handle error + } + + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + // handle error + } + return body +} \ No newline at end of file -- Gitblit v1.8.0