mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-04 12:52:28 +08:00
release: update readme.file v1.0.8, ParseHttpResponse in netutil/request.go
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<div align="center" style="text-align: center;">
|
||||
|
||||

|
||||
[](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
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div align="center" style="text-align: center;">
|
||||
|
||||

|
||||
[](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随机数处理包
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user