Sub Button1_Click
' NOTE: if you'd get error "java.security.cert.CertPathValidatorException",
' add Conditional Symbol (Ctl-B) 'HU2_ACCEPTALL'
Wait For (GetWebPageHtml("https://www.b4x.com")) Complete (result As String)
Log(result)
End Sub
Sub GetWebPageHtml(url As String) As ResumableSub
' Dependency: lib OkHttpUtils2
Dim j As HttpJob
Dim result As String = ""
j.Initialize("", Me) 'name is empty as it is no longer needed
j.Download(url)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
result = j.GetString
Else
Log("Error: " & j.ErrorMessage)
End If
j.Release
Return result
End Sub