Hi Everyone!
Gotten stuck trying to receive some data from a post request and put it into a database, I get data like this; 'PIRTIMEOUT 001306894=5000'
I need to put the 5000 (**** in the code)part into the database the other number being the device number (Num, in the code) it has to go against, but having removed the '00'.
This is where I've gotten to so far but am going round in circle trying to work it out.
Any helps great;y appreciated!!
Gotten stuck trying to receive some data from a post request and put it into a database, I get data like this; 'PIRTIMEOUT 001306894=5000'
I need to put the 5000 (**** in the code)part into the database the other number being the device number (Num, in the code) it has to go against, but having removed the '00'.
B4X:
'Handler class
Sub Class_Globals
Private mreq As ServletRequest 'ignore
Private mresp As ServletResponse 'ignore
End Sub
Public Sub Initialize
End Sub
Sub CheckSN
Dim Num As Int
If
End Sub
Sub Handle(req As ServletRequest, resp As ServletResponse)
mreq = req
Log(req)
Dim params As TextReader
params.Initialize(mreq.InputStream)
Log(params.ReadAll)
' Dim text2 As HttpJob
' text2.GetString
' Log(text2)
Dim in2 As String
in2 = params.ReadAll
'parse string to get data;****, and DeviceSN; Num
If in2.Contains(Num) Then
Dim ParamsSetter As String
ParamsSetter = "UPDATE EnergyHours(DeviceSN, StandbyLevel) VALUES ('Num', ****)"
Else
Log("Error Writing to database" & Num)
End If
End Sub
This is where I've gotten to so far but am going round in circle trying to work it out.
Any helps great;y appreciated!!