- fix retry bug (request can not be reused).
This commit is contained in:
@@ -143,9 +143,9 @@ func (a *API) AccessAPI(apiStr string, jdParams map[string]interface{}) (retVal
|
||||
params["timestamp"] = utils.GetCurTimeStr()
|
||||
sign := a.signParams(params)
|
||||
params[signKey] = sign
|
||||
request, _ := http.NewRequest(http.MethodGet, utils.GenerateGetURL(prodURL, apiStr, params), nil)
|
||||
// request, _ := http.NewRequest(http.MethodGet, utils.GenerateGetURL(prodURL, apiStr, params), nil)
|
||||
//request.Close = true //todo 为了性能考虑
|
||||
err = platformapi.AccessPlatformAPIWithRetry(a.client, request, a.config, func(response *http.Response) (errLevel string, err error) {
|
||||
err = platformapi.AccessPlatformAPIWithRetry(a.client, http.MethodGet, utils.GenerateGetURL(prodURL, apiStr, params), "", nil, a.config, func(response *http.Response) (errLevel string, err error) {
|
||||
jsonResult1, err := utils.HTTPResponse2Json(response)
|
||||
if err != nil {
|
||||
return platformapi.ErrLevelGeneralFail, platformapi.ErrResponseDataFormatWrong
|
||||
|
||||
Reference in New Issue
Block a user