|
@@ -7,6 +7,7 @@ import (
|
7
|
7
|
"encoding/json"
|
8
|
8
|
"fmt"
|
9
|
9
|
"gdyb/utils/csbhttp"
|
|
10
|
+ "strconv"
|
10
|
11
|
"time"
|
11
|
12
|
)
|
12
|
13
|
|
|
@@ -107,7 +108,7 @@ func HttpRequest(url string, ak string, sk string, timestamp int64, requestByte
|
107
|
108
|
|
108
|
109
|
//添加附加的http请求头 (可以定义多条)
|
109
|
110
|
//key := "_api_access_key=" + ak + "&_api_name=" + "hssServives" + "&_api_timestamp=" + strconv.FormatInt(timestamp, 10) + "&_api_version=" + "1.0.0"
|
110
|
|
- csbHP.AddHeader("_api_timestamp", "1627006379509")
|
|
111
|
+ csbHP.AddHeader("_api_timestamp", strconv.FormatInt(timestamp, 10))
|
111
|
112
|
csbHP.AddHeader("_api_name", "hssServives")
|
112
|
113
|
csbHP.AddHeader("_api_version", "1.0.0")
|
113
|
114
|
csbHP.AddHeader("_api_access_key", ak)
|
|
@@ -125,7 +126,7 @@ func HttpRequest(url string, ak string, sk string, timestamp int64, requestByte
|
125
|
126
|
csbHP.Print()
|
126
|
127
|
//进行调用, 返回的第二项为resonse http headers (map[string][]string类型)
|
127
|
128
|
//res, _, err := csbhttp.Invoke(*csbHP, requestByte)
|
128
|
|
- res, _, err := csbhttp.Invoke(*csbHP, "1627006379509")
|
|
129
|
+ res, _, err := csbhttp.Invoke(*csbHP, strconv.FormatInt(timestamp, 10))
|
129
|
130
|
//是否发成错误
|
130
|
131
|
if err != nil {
|
131
|
132
|
fmt.Println(err)
|