Android Question Httpjob Download2

Anser

Well-Known Member
Licensed User
Hi,

If I use HttpJob.Download it works fine, but if I use HttpJob.Download2 then I get the following error

B4X:
Error: java.lang.IllegalStateException: Target host must not be null, or set in parameters. scheme=null, host=null, path=www.myserver.com/myphp/myscripts.php

This code words fine.
B4X:
Dim Login As HttpJob
Login.Initialize("L",Me)
Login.Download("http://www.myservername.com/myphp/myscripts.php?action=Login&user_id=myuserid&password=mypassword")

But the following code fails.
B4X:
Dim Login As HttpJob
Login.Initialize("L",Me)
Login.Download2("www.myservername.com/myphp/myscripts.php", Array As String("action","Login","user_id",cUserName,"password",cPassword ) )

Any info, why Download2 is throwing such an error ?

Regards
Anser
 

DonManfred

Expert
Licensed User
The problem was the missing http:// in the url
It was the information in the error message too.
Edit: Sorry. my fault.. The error did not tell that the scheme was null; it said the host. But the host is ok in your URL
 
Upvote 0
Top