Sub ButtonGet_Click
Dim BC As String
BC = EditTextBC.Text
Dim Job As HttpJob
Job.Initialize("Job1",Me)
Job.Username="..."
Job.Password="..."
Job.Download("https://domain.com/api/barcode/1?barcode=" & BC )
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "Job1"
Dim JSON As JSONParser
JSON.Initialize(Job.GetString)
Dim Map1 As Map
Map1 = JSON.NextObject
EditTextBC.Text = Map1.Get("barcode")
EditTextResponse.Text = Map1.Get("marking")
LabelError.Text = Map1.Get("error")
'print the result to the logs
Log(Job.GetString)
End Select
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub