From 712ef81c6b8813a498a66cf61ffcd37e5c502c8c Mon Sep 17 00:00:00 2001 From: sunty <1172534965@qq.com> Date: 星期五, 01 十一月 2019 13:45:30 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- 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