J jimseng Active Member Licensed User Longtime User Apr 1, 2016 #1 Hi. I am struggling to understand a really simple thing: http://192.168.1.128/test.php?device=led&state=on in my php I have $dev=$_GET["device"]; $stat= $_GET["state"]; and I know that works by pasting it into a browser but i can't work out how to send this from b4a. Sorry for being such a newbie but I have been struggling for ages. Can someone show me how to do it. (I have been reading the tutorials but I'm afraid I just don't understand them) Thanks
Hi. I am struggling to understand a really simple thing: http://192.168.1.128/test.php?device=led&state=on in my php I have $dev=$_GET["device"]; $stat= $_GET["state"]; and I know that works by pasting it into a browser but i can't work out how to send this from b4a. Sorry for being such a newbie but I have been struggling for ages. Can someone show me how to do it. (I have been reading the tutorials but I'm afraid I just don't understand them) Thanks
S sorex Expert Licensed User Longtime User Apr 1, 2016 #2 it could be something like this Code: Dim dlj As HttpJob dlj.Initialize("setLed",Me) dlj.Download("http://192.168.1.128/test.php?device=led&state=on") Upvote 0
it could be something like this Code: Dim dlj As HttpJob dlj.Initialize("setLed",Me) dlj.Download("http://192.168.1.128/test.php?device=led&state=on")
J jimseng Active Member Licensed User Longtime User Apr 1, 2016 #3 Thanks. That was really easy Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Apr 3, 2016 #4 Another option: Code: Dim dlj As HttpJob dlj.Initialize("setLed",Me) dlj.Download2("http://192.168.1.128/test.php", Array As String("device", "led", "state", "on")) The advantage of Download2 is that it will url escape the parameters. For example if there is a space or non-ascii character in one of the parameters. Upvote 0
Another option: Code: Dim dlj As HttpJob dlj.Initialize("setLed",Me) dlj.Download2("http://192.168.1.128/test.php", Array As String("device", "led", "state", "on")) The advantage of Download2 is that it will url escape the parameters. For example if there is a space or non-ascii character in one of the parameters.
J jimseng Active Member Licensed User Longtime User Apr 7, 2016 #5 Hi. I have found I need some feedback from the web server to check that it has happened. The web page just does an echo of the parameters. Ho can I retreive that into a string to check it? Upvote 0
Hi. I have found I need some feedback from the web server to check that it has happened. The web page just does an echo of the parameters. Ho can I retreive that into a string to check it?
S sorex Expert Licensed User Longtime User Apr 7, 2016 #6 you need the jobdone sub where you can read out the response. do a search on jobdone and you should find the tutorial. Upvote 0
you need the jobdone sub where you can read out the response. do a search on jobdone and you should find the tutorial.
Erel B4X founder Staff member Licensed User Longtime User Apr 8, 2016 #7 HttpUtils2 - Web services are now even simpler Upvote 0