#Region Module Attributes
#FullScreen: False
#IncludeTitle: True
#ApplicationLabel: HttpUtils2
#VersionCode: 1
#VersionName:
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
'Activity module
Sub Process_Globals
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim job1, job2, job3 As HttpJob
'job1.Initialize("Job1", Me)
'Send a GET request
'job1.Download2("http://www.b4x.com/print.php", _
' Array As String("first key", "first value :)", "second key", "value 2"))
'Send a GET request
job3.Initialize("Job3", Me)
job3.Download("http://www.******.com")
job3.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)")
job3.GetRequest.SetHeader("Accept ", "*/*")
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "Job1", "Job2", "Job3"
'print the result to the logs
ToastMessageShow(Job.GetString,True)
End Select
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub