B4J Question Problem with Post in JOkHttpUtils2_NONUI [ Official ]

Waldemar Lima

Well-Known Member
Licensed User
hi everyone !
i am trying send a POST request using JOkHttpUtils2_NONUI library , but "http.PostString" dont return nothing

here procedure :

B4X:
Sub Process_Globals
    Private http As HttpJob
    Dim ReturnResult As String
End Sub

Public Sub Post(url As String,postString As String) As String
   
    If (http.IsInitialized = True) Then
        ReturnResult = http.PostString(url,postString)
        Log("HttpRequest = "&ReturnResult)
        Return ReturnResult
    Else  
        Log("HttpJob need be initialized !")
        Return "Error"
    End If
   
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
ReturnResult = http.PostString(url,postString)
PostString does NOT Return anything!

Go over the httputils tutorial and understand how it works.

You need to wait for the JobDone Event get raised and get the result here is the job was successfully.
 
Upvote 0
Top