Good afternoon to all of you,
I am totally confused. I have created a Class in a JettyServer application that makes requests to an on line REST API. I used this code:
The problem is it works perfect. Then I noticed that I did not need the StartMessageLoop and StopMessageLoop in response. The class is called from a WebSockets class. Is it normal behaviour or I have done something strange? The code is executed on a button click.
I am totally confused. I have created a Class in a JettyServer application that makes requests to an on line REST API. I used this code:
B4X:
Dim sURL As String = "https://myapi.com/v2/setvalue"
Log(sURL)
hj.PostString(sURL, sRequestJSON)
hj.GetRequest.SetHeader("Authorization", sBearer)
hj.GetRequest.SetContentType("application/json")
Log("-2-")
wait for (hj) JobDone (hj As HttpJob)
Log($"Status Check ${hj.Response.StatusCode}"$)
sResp = ""
The problem is it works perfect. Then I noticed that I did not need the StartMessageLoop and StopMessageLoop in response. The class is called from a WebSockets class. Is it normal behaviour or I have done something strange? The code is executed on a button click.