Hi,
ich den "devicetype" auf den server pstest posten:
der devicetype ist im json format ... ich finde nicht was falsch sein sollte??
wäre super wenn ihr evenrtuell einen fehler seht
danke
Private Sub CommandButton2_Click()
Dim result As String
Dim myURL As String, postData As String
Dim WinHttpReq As Object
Set WinHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
myURL = "https://pstest.cumulocity.com/inventory/managedObjects"
Name = Andi
Number = 12
register = "{'name': Name, 'number': Number, 'decimalPlaces': 0}"
deviceType = "{ 'name': File1, 'type': 'c8y_ModbusDeviceType', 'c8y_Coils': coils, 'c8y_Registers': registers }"
Data = deviceType
WinHttpReq.Open "POST", myURL, False
WinHttpReq.SetRequestHeader "Content-Type", "application/vnd.com.nsn.cumulocity.managedObject+json"
WinHttpReq.SetCredentials "user", "pass", HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
WinHttpReq.send Data
result = WinHttpReq.responseText
End Sub
|