Hi smart people,
I have a problem when I call a Rest API using HttpJob, the Wait For goes immediatly to the following line: no execution
I use the same API in a Non-UI Application, where I add a StartMessageLoop before calling the getAllIoTemplates function and a StopMessageLoop at the end of the getAllIoTemplates function : in this case no problem....
Libraries used:
OkHttp V1.22
JOKHttpUtils2 V2.92
JHTTP V1.11 ( I think it's useless)
Here is the code :
Any help or suggestion will be greatly appreciated
Patrick
I have a problem when I call a Rest API using HttpJob, the Wait For goes immediatly to the following line: no execution
I use the same API in a Non-UI Application, where I add a StartMessageLoop before calling the getAllIoTemplates function and a StopMessageLoop at the end of the getAllIoTemplates function : in this case no problem....
Libraries used:
OkHttp V1.22
JOKHttpUtils2 V2.92
JHTTP V1.11 ( I think it's useless)
Here is the code :
code fragment:
Sub Button1_Click
getIoTemplateId
End Sub
Sub getAllIoTemplates
Dim job As HttpJob
'TemplateId Global Variable , RAZ to ""
TemplateId = ""
'Get all templates
Dim ci As String
ci="https://api.safetyculture.io/templates/search"
ci = ci & "?field=name"
job.Initialize("", Me)
job.Download(ci)
job.GetRequest.SetHeader("authorization", "Bearer " & cIOToken)
Wait For (job) JobDone(job As HttpJob)
If job.Success Then
Log(job.GetString)
Else
xui.Msgbox2Async("Pb pour accèder à l'API iAuditor : /templates/search" & CRLF & "Maybe check Bearer","CEE to iAuditor","","","",Null)
End If
job.release
End Sub
Any help or suggestion will be greatly appreciated
Patrick