Hi Erel, All.
Are there issues with iHttpUtils2 Rel. 2.96 and B4I V7.50 ?
If i have this code:
B4X:
Dim DONACASHBACK As HttpJob
DONACASHBACK.Initialize("", Me)
DONACASHBACK.Download2(Main.variabile, Array As String("Action","56","id", $"${id}"$))
Wait For (DONACASHBACK) JobDone(DONACASHBACK As HttpJob)
If DONACASHBACK.Success Then
pnl_attendi.Visible = True
btn_dona.Visible = False
Sleep(200)
Dim res As String
res = DONACASHBACK.GetString
......
Crash ( debug and release ) on
B4X:
res = DONACASHBACK.GetString
and error is:
Error reading from stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
The data it receives from the server is stored in a temporary file. when you call the getString (or other get) method this temporary file is read.
When you use sleep and exit of the SUB obviously this file is deleted and cannot be used again. At the getstring request it generates an error because it cannot find the file.
Suggest: Insert the sleep after saving the data received from the getstring in a string
He also gave it to me on b4a on one occasion. I think a lot depends on the service that manages httpJob. I don't know the engine inside and can't answer
In iOS, you can only access the response in the JobDone event. Sleep / Wait For are equivalent to calling Return so the response is no longer available.