diff --git a/platformapi/jdshopapi/store_page.go b/platformapi/jdshopapi/store_page.go index 73d043a0..c5177229 100644 --- a/platformapi/jdshopapi/store_page.go +++ b/platformapi/jdshopapi/store_page.go @@ -21,6 +21,10 @@ func (a *API) AccessStorePage(fullURL string, bizParams map[string]interface{}, if isPost { request, _ = http.NewRequest(http.MethodPost, fullURL, strings.NewReader(utils.Map2URLValues(bizParams).Encode())) request.Header.Set("Content-Type", "application/x-www-form-urlencoded") + request.Header.Set("accept", "application/json, text/plain, */*") + request.Header.Set("accept-encoding", "gzip, deflate, br") + request.Header.Set("accept-language", "zh-CN,zh;q=0.9") + request.Header.Set("referer", "https://stores.shop.jd.com/") } else { request, _ = http.NewRequest(http.MethodGet, utils.GenerateGetURL(fullURL, "", bizParams), nil) } diff --git a/platformapi/platformapi.go b/platformapi/platformapi.go index 99cc2196..060e176d 100644 --- a/platformapi/platformapi.go +++ b/platformapi/platformapi.go @@ -117,8 +117,6 @@ func AccessPlatformAPIWithRetry(client *http.Client, handleRequest func() *http. } trackInfo += ", " + utils.GetUUID() baseapi.SugarLogger.Debugf("begin AccessPlatformAPIWithRetry:%s do:%s url:%v, request:%s", trackInfo, request.Method, request.URL, getClonedData(request.URL, savedBuf)) - fmt.Println("test1", utils.Format4Output(request, false)) - fmt.Println("test1", utils.Format4Output(request.Context(), false)) response, err := client.Do(request) usedMilliSecond := time.Now().Sub(beginTime) / time.Millisecond baseapi.SugarLogger.Debugf("end AccessPlatformAPIWithRetry:%s do:%s url:%v, usedMilliSecond:%d", trackInfo, request.Method, request.URL, usedMilliSecond)