-9cf)
-[](https://github.com/duke-git/lancet/releases)
+[](https://github.com/duke-git/lancet/releases)
[](https://pkg.go.dev/github.com/duke-git/lancet)
[](https://goreportcard.com/report/github.com/duke-git/lancet)
[](https://codecov.io/gh/duke-git/lancet)
@@ -323,6 +323,7 @@ func HttpPut(url string, params ...interface{}) (*http.Response, error) //http p
func HttpDelete(url string, params ...interface{}) (*http.Response, error) //http delete request
func HttpPatch(url string, params ...interface{}) (*http.Response, error) //http patch request
func ConvertMapToQueryString(param map[string]interface{}) string //convert map to url query string
+func ParseHttpResponse(resp *http.Response, obj interface{}) error //decode http response to specified interface
```
#### 8. random is for rand string and int generation
diff --git a/README_zh-CN.md b/README_zh-CN.md
index c99c88a..e720029 100644
--- a/README_zh-CN.md
+++ b/README_zh-CN.md
@@ -6,7 +6,7 @@

-[](https://github.com/duke-git/lancet/releases)
+[](https://github.com/duke-git/lancet/releases)
[](https://pkg.go.dev/github.com/duke-git/lancet)
[](https://goreportcard.com/report/github.com/duke-git/lancet)
[](https://codecov.io/gh/duke-git/lancet)
@@ -324,6 +324,7 @@ func HttpPut(url string, params ...interface{}) (*http.Response, error) //http p
func HttpDelete(url string, params ...interface{}) (*http.Response, error) //http delete请求
func HttpPatch(url string, params ...interface{}) (*http.Response, error) //http patch请求
func ConvertMapToQueryString(param map[string]interface{}) string //将map转换成url query string
+func ParseHttpResponse(resp *http.Response, obj interface{}) error //将http响应解码成特定interface
```
#### 8. random随机数处理包
diff --git a/netutil/request.go b/netutil/request.go
index 4e26994..baf563e 100644
--- a/netutil/request.go
+++ b/netutil/request.go
@@ -45,7 +45,7 @@ func HttpPatch(url string, params ...interface{}) (*http.Response, error) {
return request(http.MethodPatch, url, params...)
}
-// ParseHttpResponse convert the http response to interface{} obj
+// ParseHttpResponse decode http response to specified interface
func ParseHttpResponse(resp *http.Response, obj interface{}) error {
if resp == nil {
return errors.New("InvalidResp")