Hi, my App consumes a REST API, but I don't want to wait more than 6 seconds for the response, I use the Job.GetRequest.Timeout = 6000, but there are many times that it waits up to 40 seconds, it doesn't respect the 6 seconds of the Job.GetRequest .Timeout. This is my code:
I'm not sure if the position of the GetRequest.Timeout is correct.
I will appreciate any help you can give me.
Regards,
B4X:
Dim XJob As HttpJob
XJob.Initialize("FEL", Me)
XJob.PostString("www.url.com", XML)
XJob.GetRequest.SetContentType("application/xml")
XJob.GetRequest.SetHeader("User", "12345")
XJob.GetRequest.SetHeader("Password", "12345")
XJob.GetRequest.Timeout = 6000 '6 seconds
Wait For (XJob) JobDone(XJob As HttpJob)
If XJob.Success Then
sJSON = XJob.GetString
...............
I'm not sure if the position of the GetRequest.Timeout is correct.
I will appreciate any help you can give me.
Regards,