Wait For (Manager.ListRequest(Filter)) Complete (List1 As List)
For Each Item As ItemType In List1
Sub ListRequest(Filter As String) As ResumableSub
Dim Job As HttpJob
Job.Initialize("",Me)
Job.Username = Main.Username
Job.Password = Main.Password
Job.Download2("https://" & Main.Server & "/request", Array As String("cmd", "list", "filter", Filter))
Dim ser As B4XSerializator
Dim List1 As List
List1.Initialize
Wait For (Job) JobDone(Job As HttpJob)
If Job.Success Then
Dim buffer(Job.GetInputStream.BytesAvailable) As Byte
Job.GetInputStream.ReadBytes(buffer, 0, buffer.length)
List1 = ser.ConvertBytesToObject(buffer)
'Log(List1.Size)
End If
Job.Release
Return List1
End Sub