I would like to post a quiz like question too.
If you have the following code (pseudocode, dont kill me for syntax errors) when doing Http Requests.
When will you get an error with this code, what error will you get, and how to resolve the issue?
If you have the following code (pseudocode, dont kill me for syntax errors) when doing Http Requests.
B4X:
Sub ProcessNextTask
If TaskCount > 0 Then
TaskCount = TaskCount - 1
req = CreateHttpRequest(FileDownloadLink)
ExecuteRequest(req)
End If
End Sub
Sub ExecuteRequest(req as HttpRequest)
If File.ExternalWritable = False then
'Abort Download but process Next Task
ProcessNextTask
Else
HttpClient1.Execute(req, taskid)
End If
End Sub
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
Response.GetAsynchronously("response", File.OpenOutput(TempFolder, TaskId, False), _
True, TaskId)
End Sub
Sub Response_StreamFinish (Success As Boolean, TaskId As Int)
ProcessNextTask
End Sub
Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
ProcessNextTask
End Sub
When will you get an error with this code, what error will you get, and how to resolve the issue?