openapi-sdk-go
介绍
dataoke openapi sdk for go
安装教程
go get -u gitee.com/dtk-developer/openapi-sdk-go/sdk
使用说明
package main
import (
"fmt"
"gitee.com/dtk-developer/openapi-sdk-go/sdk"
)
func main() {
var (
apiUrl = "https://openapi.dataoke.com/api/goods/get-goods-list"
appKey = "xxxxxx"
appSecret = "xxxxxxxxxx"
version = "v1.2.4"
params = make(map[string]string)
)
client, err := sdk.NewClientWithAccessKey(appKey, appSecret, version)
if err != nil {
panic(err)
}
params["pageId"] = "1"
params["pageSize"] = "10"
rsp, err := client.Request(apiUrl, params, sdk.GET)
if err != nil {
panic(err)
}
fmt.Println(rsp)
}