- change all request to NewRequest, don't use bare Request{}.
- MessageTemplateSend added. - refactor weixin api.
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"sort"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
@@ -147,12 +146,7 @@ func (a *API) AccessAPI(apiStr string, jdParams map[string]interface{}) (retVal
|
||||
params["timestamp"] = utils.GetCurTimeStr()
|
||||
sign := a.signParams(params)
|
||||
params[signKey] = sign
|
||||
|
||||
finalURL, _ := url.Parse(utils.GenerateGetURL(prodURL, apiStr, params))
|
||||
request := &http.Request{
|
||||
Method: "GET",
|
||||
URL: finalURL,
|
||||
}
|
||||
request, _ := http.NewRequest(http.MethodGet, utils.GenerateGetURL(prodURL, apiStr, params), 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