Android Question httpjob does not step in if j.success statement

Jeffrey Nidoy

New Member
Licensed User
Hi everyone, im new to b4a and learning on my own. Am i doing the right thing to get the strings from this example url . Thank you

Im trying to run the code one line at a time and httpjob does not step in if statement.
thanks for your help

B4X:
Sub send_url
Dim j As HttpJob
j.Initialize("",Me)
j.download("https://www.tpcph.com/sa/index.php?c=jeffrey|123")

Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Log(j.getstring)
MsgboxAsync(j.GetString,"laman")
End If

j.Release

End Sub
 

Attachments

  • ss.PNG
    16.2 KB · Views: 148
Last edited:

BillMeyer

Well-Known Member
Licensed User
Longtime User
Hi Jeffrey,
Welcome here. There is a large group of very helpful B4Xers here that will unconditionally help you - provided a few conditions are met.

Start by reading this How to post
And then watching Erels videos and reading Klaus' Booklets.

Then, when you want to post code (as an example or whatever) at the top of the post is a toolbar - there you will find CODE - use that to post your code.

Good luck.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
His question was "How to use GET", by the time I posted the answer that he should use j.download, the topic changed to Need help Erel...

2 very basic rules are among those suggested by @BillMeyer

1 - Try to make your Title as relevant as possible!
2 - DON'T limit your question to any 1 user! (even if that user is EREL)
 
Upvote 0

Jeffrey Nidoy

New Member
Licensed User
Sorry guys. ill update my title
I tried mcqueccu suggestion using j.download(url) but what happens is it skips to the next sub and does not step in if j.success.
 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
I tried using AcceptAll Option and it worked.

@Jeffrey Nidoy Press CTRL+B and add this to conditional symbols - last box

HU2_ACCEPTALL



RESULT:
Service started in foreground mode.
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (httputils2service) Create ***
(Http client initialized with accept all option.)
** Service (httputils2service) Start **
1|Welcome to UP Town Mall.
2021-02-15 04:44:18
PCL100
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…