H hung Active Member Licensed User Longtime User May 4, 2020 #1 I am using OkHttpUtils2 to create httpjob as below B4X: Copy Dim lHttpJob As HttpJob ' use local resource to avoid crash lHttpJob.Initialize("job1", Me) lHttpJob.PostString("https://abcd.com/test.php", "pageno=p1") B4X: Copy Sub JobDone (Job As HttpJob) If Job.Success = True Then Select Job.JobName Case "job1" webview.LoadHtml(Job.GetString) ... Job.release End sub The page returns something like below to Job.GetString B4X: Copy <html> <body> Picture 1: <img src=p1.jpg> </body> </html> I am expecting the webview shows a html page with the picture loaded. But the word "Picture 1:" shows with a broken image. Any solution for this?
I am using OkHttpUtils2 to create httpjob as below B4X: Copy Dim lHttpJob As HttpJob ' use local resource to avoid crash lHttpJob.Initialize("job1", Me) lHttpJob.PostString("https://abcd.com/test.php", "pageno=p1") B4X: Copy Sub JobDone (Job As HttpJob) If Job.Success = True Then Select Job.JobName Case "job1" webview.LoadHtml(Job.GetString) ... Job.release End sub The page returns something like below to Job.GetString B4X: Copy <html> <body> Picture 1: <img src=p1.jpg> </body> </html> I am expecting the webview shows a html page with the picture loaded. But the word "Picture 1:" shows with a broken image. Any solution for this?
Erel B4X founder Staff member Licensed User Longtime User May 5, 2020 #3 Whenever you see code with JobDone you immediately know that that it is wrong. Learn how to use Wait For: [B4X] OkHttpUtils2 with Wait For Upvote 0
Whenever you see code with JobDone you immediately know that that it is wrong. Learn how to use Wait For: [B4X] OkHttpUtils2 with Wait For
H hung Active Member Licensed User Longtime User May 10, 2020 #4 Erel said: Whenever you see code with JobDone you immediately know that that it is wrong. Learn how to use Wait For: [B4X] OkHttpUtils2 with Wait For Click to expand... Turn out as server response issue. When connectivity ("server" side) is good then no issue. Thanks Erel. Upvote 0
Erel said: Whenever you see code with JobDone you immediately know that that it is wrong. Learn how to use Wait For: [B4X] OkHttpUtils2 with Wait For Click to expand... Turn out as server response issue. When connectivity ("server" side) is good then no issue. Thanks Erel.