B4A Tutorial [B4X] OkHttpUtils2 with Wait For - Erel    Dec 25, 2025   (59 reactions)   tags: image, wait, Download, Http MySql, Wait For, ws have a single sub that handles all requests results. Simplest example: Dim j As HttpJob j... As HttpJob) If j.Success Then Log(j.GetString) End If j.Release Example of downloading a quote from a quotes service: Sub DownloadQuote Dim j As HttpJob j.Initialize("", Me) 'name...=rand") Wait For (j) JobDone(j As HttpJob) If j.Success Then 'The result...("content")) Next End If j.Release End Sub Note that the HttpJob object is a local... B4J Question HttpJob when Proxy is active - udg    Nov 28, 2022 . What should I do? As an example of data transmission, I have: Dim pJob As HttpJob pJob.Initialize("", Me) pJob.PostBytes(wscsync, buffer) Wait For (pJob) JobDone(j As HttpJob) wscsync is: Public const wscsync As String = "https://<mydomain>:62238/mnog"...): SetSystemProperty("http.proxyHost","webwasher.xxxx.com") SetSystemProperty("https.proxyHost", "webwasher.xxx.com") SetSystemProperty("http... B4A Question Use custom SSL in httpjob - is it possible... - Magma    Jun 10, 2025 - i think (may be not easy to use httpjob) - or need a special setup ??
Dim j As HttpJob...-----------
wait for (j) JobDone(j As HttpJob)
Log(j.GetString... B4A Question How to treat httpjob timeout? - wimpie3    Nov 10, 2021 I want to detect a timeout with httpjob. I'm doing this: Dim Job1 As HttpJob Job1.Initialize(...) Job1.Poststring(...) Job1.GetRequest.Timeout =5000 ' 5 seconds Wait For (j) JobDone(j As HttpJob) If j.Success Then Log("succes") Else Log("failed") End If When I start my app without internet connection, I thought the "failed" message would be shown after 5 seconds. But nothing happens. It seems that Android is trying to do the PostString and "hangs... B4A Question [Solved] HttpJob error with unexpected end of stream - max123    May 25, 2024 B4A with OkHttpUtils2 and HttpJob. Because I will test on Android Emulator, initially I had...) End Sub Sub DownloadAndSaveFile (Link As String) Dim j As HttpJob j.Initialize(""....SetHeader ("Connection", "close") Wait For (j) JobDone(j As HttpJob... The problem now is that the HttpJob fails with this error: ERROR: java.net.ProtocolException...Hi all, I started on my PC an http server to serve a directory. In Windows prompt I write... B4J Question HttpJob B4X Difference with .NET ? - Magma    Apr 25, 2024 As HttpJob j.Initialize("viva",Me) j.postString(usingurl & "transactions:sale.../json") J.GetRequest.SetContentType("application/json") Wait For (j) JobDone(j As HttpJob) 'Log(j.GetString) If j.Success=True Then If j.GetString.Contains..., "application/json") httpClient.DefaultRequestHeaders.Authorization = New Headers.AuthenticationHeaderValue("Bearer", AccessToken) Dim response = Await httpClient... Bug? Issues with B4A/B4J HttpJob.Response.ContentLength - OliverA    Mar 31, 2024 In B4J and B4A, HttpJob.Response.ContentLength seems to always return 0 when using HttpJob.Head. In... : https://www.b4x.com/android/forum/threads/solved-question-about-okhttputils2-response-contentlength.160216/) This is the code snippet: Dim filename As String = "https://b4x-4c17.kxcdn.com/android/forum/data/avatars/m/86/86664.jpg?1520274433" Dim j As HttpJob j.Initialize("", Me) j.head(filename) Wait For (j) JobDone(j As HttpJob) If j.Success Then... B4J Question How do I detect a Http_job has timed out when I use Wait For - JackKirk    Sep 9, 2022 I have a Http_job, the bare bones of the relevant code to execute it are: Private XXX_job As Http_Job XXX_job.Initialize("List", Me) wrk_URI stuff here XXX_job.Download(wrk_URI) XXX_job.GetRequest.Timeout = 30 * DateTime.TicksPerSecond 'I know this is the default wrk_Authorization stuff here XXX_job.GetRequest.SetHeader("Authorization", wrk_Authorization) Wait For (XXX_job) JobDone (Job As Http_Job) Occasionally... B4J Question [Banano] Converting httpjob code from B4A - toby    Sep 8, 2022 .ToPrettyString(1) 'indent by 1 space Dim J As HttpJob 'depends OKHttpUtils2 J.Initialize("J",Me) J.PostString("https://mysite.com/getdetail.php" , data ) Wait For (j) JobDone(j As HttpJob) If j.Success=False Then j.Release Log... B4J Question HttpJob in BackGroundWorker compared to PyBridge server example. Benchmark. Is it correct? - hatzisn    Dec 3, 2025 do the same with an HttpJob in the worker class then what happens in the background worker class...
End Sub
Sub MakeMultipleRequests
For ii = 1 To 50
Dim hj As HttpJob
hj... Page: 1   2   3   4   5   6   7   |