添加钉钉通知

This commit is contained in:
linxiaozhi
2019-02-15 11:50:09 +08:00
parent fbd64d38a2
commit 5a7904a831
15 changed files with 186 additions and 6 deletions

View File

@@ -13,6 +13,7 @@ import (
"io/ioutil"
"net/http"
"strings"
"io"
)
type AjaxReturn struct {
@@ -56,3 +57,22 @@ func HttpGet(url string, param map[string]string) error {
}
return nil
}
func HttpPost(url string, contentType string, body io.Reader) error {
resp, err := http.Post(url, contentType, body)
if err != nil {
return err
}
defer resp.Body.Close()
_, resErr := ioutil.ReadAll(resp.Body)
if resErr != nil {
return resErr
}
return nil
}