京东商城

This commit is contained in:
苏尹岚
2020-05-21 09:26:57 +08:00
parent 4d50502e65
commit ce5c226500
4 changed files with 60 additions and 19 deletions

View File

@@ -1,6 +1,9 @@
package jdshopapi
import (
"fmt"
"io/ioutil"
"net/http"
"testing"
"git.rosy.net.cn/baseapi/utils"
@@ -35,3 +38,18 @@ func TestNewInfoList(t *testing.T) {
}
t.Log(utils.Format4Output(result, false))
}
func Test11(t *testing.T) {
request, _ := http.NewRequest(http.MethodGet, "https://stores.shop.jd.com/stores/updateStoreStatus?storeId=24332466&storeStatus=1", nil)
c := &http.Cookie{
Name: "thor",
Value: "80FAF09E9A09B6E618A68057BDFCFCB8C86E8252DC9F7D3B34572625904FBA0AB6BF053A5325612EC0407791BB05F5301356E71E8B282C40C06D0B5DF3439DEECB102A78FAFF7AC0FC4E2D1FA8DD8BBAE1A011E50B5C74F1870AD982D7BF453F470F31F2241B73AC4C25485025C2ABEBC8A538AF7257824D2FAEE300A1435175B0B451FB5C19B78D729FC83152CA3BAF",
}
request.AddCookie(c)
client := &http.Client{}
fmt.Println("test1", request.URL)
response, _ := client.Do(request)
defer response.Body.Close()
bodyData, _ := ioutil.ReadAll(response.Body)
fmt.Println("test1", string(bodyData))
}