Duhell New Member Jul 22, 2023 #1 Can anyone here help me to how to use the HTTP GET? I just want to log the response to this api https://jsonplaceholder.typicode.com/posts/1, I'm new to b4a
Can anyone here help me to how to use the HTTP GET? I just want to log the response to this api https://jsonplaceholder.typicode.com/posts/1, I'm new to b4a
Erel B4X founder Staff member Licensed User Longtime User Jul 23, 2023 #2 B4X: Private Sub Button1_Click Dim j As HttpJob j.Initialize("", Me) j.Download("https://jsonplaceholder.typicode.com/posts/1") Wait For (j) JobDone(j As HttpJob) If j.Success Then Log(j.GetString) Else Log(j.ErrorMessage) End If j.Release End Sub [B4X] OkHttpUtils2 with Wait For Upvote 0
B4X: Private Sub Button1_Click Dim j As HttpJob j.Initialize("", Me) j.Download("https://jsonplaceholder.typicode.com/posts/1") Wait For (j) JobDone(j As HttpJob) If j.Success Then Log(j.GetString) Else Log(j.ErrorMessage) End If j.Release End Sub [B4X] OkHttpUtils2 with Wait For