|
var time = import("time")
var fmt = import("fmt")
var http = import("net/http")
var json = import("encoding/json")
var io = import("io")
var ioutil = import("io/ioutil")
var bytes = import("bytes")
for{
ResponseData = map[string]interface{}
DataList = make([]struct {
DataModelFlag string,
Value string
},2)
DataList[0].DataModelFlag = "0873eeec-0c90-4791-80b7-a0158b9cc373"
DataList[0].Value = "11"
DataList[1].DataModelFlag = "ef4fe17d-23ef-0cd2-42a5-9d955477ca70"
DataList[1].Value = "33"
ResponseData["AccessToken"]="4z0sua3z1wovyah22orkw6kpv5camwd7"
ResponseData["DeviceFlag"]="21d1a335-f60b-c2ee-5b7e-956441d8ad8e"
ResponseData["UpdateList"] = DataList
responseJsonData,err = json.Marshal(ResponseData)
reader = bytes.NewReader(responseJsonData)
r = http.DefaultClient.Post("http://127.0.0.1:8081/api/v1/PushDeviceData","application/json",reader)
time.Sleep(5*time.Second)
}
|
|