padvou Active Member Licensed User Longtime User Jun 6, 2017 #1 Hello, I'm writing this question because I ran into the same issue as described in this: https://www.b4x.com/android/forum/threads/okhttp-responsesuccess-not-satisfied-with-code.54758/#content How can I convert this code: Code: Sub HC_ResponseSuccess(Response As HttpResponse, TaskId As Int) ProjectCode.IPAddress = Response.GetString("UTF8") Log(Response.GetString("UTF8")) 'Returns contents End Sub to somthing that's OKhttp compatible? Please give me a working example of the code above. Thank you in advance.
Hello, I'm writing this question because I ran into the same issue as described in this: https://www.b4x.com/android/forum/threads/okhttp-responsesuccess-not-satisfied-with-code.54758/#content How can I convert this code: Code: Sub HC_ResponseSuccess(Response As HttpResponse, TaskId As Int) ProjectCode.IPAddress = Response.GetString("UTF8") Log(Response.GetString("UTF8")) 'Returns contents End Sub to somthing that's OKhttp compatible? Please give me a working example of the code above. Thank you in advance.
R ronell Well-Known Member Licensed User Longtime User Jun 6, 2017 #2 not sure if this is what you are looking for Code: Sub JobDone (Job As HttpJob) Log("JobName = " & Job.JobName & ", Success = " & Job.Success) If Job.Success = True Then dim res as string res = Job.GetString else Job.Release Upvote 0
not sure if this is what you are looking for Code: Sub JobDone (Job As HttpJob) Log("JobName = " & Job.JobName & ", Success = " & Job.Success) If Job.Success = True Then dim res as string res = Job.GetString else Job.Release
Erel B4X founder Staff member Licensed User Longtime User Jun 6, 2017 #3 You should use OkHttpUtils2. If you are developing with B4A 7+ the it is even simpler: [B4X] OkHttpUtils2 with Wait For Upvote 0
You should use OkHttpUtils2. If you are developing with B4A 7+ the it is even simpler: [B4X] OkHttpUtils2 with Wait For