Hi
I am having an issue running a HttpJob in a Server Handle when in release mode running on multi thread mode, single threaded mode and debug work seem to be ok. The issue is I set a Authorization token on the header object of the job.GetRequest to authenticate with a external API and what seems randomly the header information is lost along with the authorization token making the call to fail. I have used a network sniffer to see the calls between my server and the external api server and the calls that fail have the header that I set missing. Is there something you need to do differently for these calls in handler for the multi thread. The code is below, I am using the message loop to wait for the job to complete before finishing the handler.
Below is the header information that is missing on failed call and a call where the data is correct.
Any help appreciated
I am having an issue running a HttpJob in a Server Handle when in release mode running on multi thread mode, single threaded mode and debug work seem to be ok. The issue is I set a Authorization token on the header object of the job.GetRequest to authenticate with a external API and what seems randomly the header information is lost along with the authorization token making the call to fail. I have used a network sniffer to see the calls between my server and the external api server and the calls that fail have the header that I set missing. Is there something you need to do differently for these calls in handler for the multi thread. The code is below, I am using the message loop to wait for the job to complete before finishing the handler.
B4X:
Dim j As HttpJob
j.Initialize("",Me)
j.PostString($"${fnlServer}/xxxx/GetDocUploadList"$, payload)
j.GetRequest.SetContentType("application/json")
j.GetRequest.SetHeader("Authorization", "Bearer " & access_token)
wait for (j) JobDone(j As HttpJob)
If j.Success Then
Dim response As String = j.GetString
....
Else
Log(j.ErrorMessage)
End If
Below is the header information that is missing on failed call and a call where the data is correct.
Any help appreciated