B bbonilla Member Licensed User Longtime User Apr 24, 2014 #1 Hello I'm trying to pass commands to my APP via the URL, like this http://localhost:8080/command1/value1/value2 I don't see how I can use the server handler to handle any of the value1 and value2 srvr.AddHandler("/command1/value1/value2", "Command1", False) How can I trap the "command1" and it's values Thank you for any help BB
Hello I'm trying to pass commands to my APP via the URL, like this http://localhost:8080/command1/value1/value2 I don't see how I can use the server handler to handle any of the value1 and value2 srvr.AddHandler("/command1/value1/value2", "Command1", False) How can I trap the "command1" and it's values Thank you for any help BB
Daestrum Expert Licensed User Longtime User Apr 25, 2014 #2 The usual format for passing parameters is http://whateverwebsite.com/page?val1=value1&val2=value2 If I am not mistaken. Upvote 0
The usual format for passing parameters is http://whateverwebsite.com/page?val1=value1&val2=value2 If I am not mistaken.
B bbonilla Member Licensed User Longtime User Apr 25, 2014 #3 Daestrum said: The usual format for passing parameters is http://whateverwebsite.com/page?val1=value1&val2=value2 If I am not mistaken. Click to expand... Thank you, for your answer, but is not what I'm looking for. I need To send the data in the format above and parse the command1 and the values1 and values2. I hope Erel can help. Thank you. Upvote 0
Daestrum said: The usual format for passing parameters is http://whateverwebsite.com/page?val1=value1&val2=value2 If I am not mistaken. Click to expand... Thank you, for your answer, but is not what I'm looking for. I need To send the data in the format above and parse the command1 and the values1 and values2. I hope Erel can help. Thank you.
B billzhan Active Member Licensed User Longtime User Apr 26, 2014 #4 You can try B4X: srvr.AddHandler("/command1/*", "Command1", False) and in the handle,you can get the RequestURI and parse the value1&value2 B4X: dim reqstring=req.RequestURI ' ->/command1/value1/value2 Be careful when value1 and value2 contains special chars( "/", tab,space etc") page?val1=value1&val2=value2 is a more common and flexible way. Upvote 0
You can try B4X: srvr.AddHandler("/command1/*", "Command1", False) and in the handle,you can get the RequestURI and parse the value1&value2 B4X: dim reqstring=req.RequestURI ' ->/command1/value1/value2 Be careful when value1 and value2 contains special chars( "/", tab,space etc") page?val1=value1&val2=value2 is a more common and flexible way.
B bbonilla Member Licensed User Longtime User Apr 26, 2014 #5 Thank you for your help, I have it working. This is what I was missing (dim reqstring=req.RequestURI) Upvote 0
Thank you for your help, I have it working. This is what I was missing (dim reqstring=req.RequestURI)