- change all request to NewRequest, don't use bare Request{}.
- MessageTemplateSend added. - refactor weixin api.
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
@@ -101,11 +100,7 @@ func (a *API) AccessAPI(apiStr string, params map[string]interface{}) (retVal Re
|
||||
params2 := utils.MergeMaps(utils.Params2Map("key", a.key, "output", "json"), params)
|
||||
params2[signKey] = a.signParams(params2)
|
||||
|
||||
finalURL, _ := url.Parse(utils.GenerateGetURL(prodURL, apiStr, params2))
|
||||
request := &http.Request{
|
||||
Method: "GET",
|
||||
URL: finalURL,
|
||||
}
|
||||
request, _ := http.NewRequest(http.MethodGet, utils.GenerateGetURL(prodURL, apiStr, params2), nil)
|
||||
err = platformapi.AccessPlatformAPIWithRetry(a.client, request, a.config, func(response *http.Response) (errLevel string, err error) {
|
||||
jsonResult1, err := utils.HTTPResponse2Json(response)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user