B4A=true
Group=Library Modules
ModulesStructureVersion=1
Type=Class
Version=7.28
@EndOfDesignText@
'version 2.70
'Class module
Sub Class_Globals
Public JobName As String
Public Success As Boolean
Public Username, Password As String
Public ErrorMessage As String
Private target As Object
#if B4A or B4J
Private taskId As String
Private req As OkHttpRequest
Public Response As OkHttpResponse
#Else
Private req As HttpRequest
Public Response As HttpResponse
#End If
Public Tag As Object
Type MultipartFileData (Dir As String, FileName As String, KeyName As String, ContentType As String)
#If B4J AND UI
Private fx As JFX
#End If
End Sub
'Initializes the Job.
'Name - The job's name. Note that the name doesn't need to be unique.
'TargetModule - The activity or service that will handle the JobDone event.
Public Sub Initialize (Name As String, TargetModule As Object)
JobName = Name
target = TargetModule
End Sub
'Sends a POST request with the given data as the post data.
Public Sub PostString(Link As String, Text As String)
PostBytes(Link, Text.GetBytes("UTF8"))
End Sub
'Sends a POST request with the given string as the post data
Public Sub PostBytes(Link As String, Data() As Byte)
req.InitializePost2(Link, Data)
CallSubDelayed2(HttpUtils2Service, "SubmitJob", Me)
End Sub