-->
Page 1 of 2

wget() parameters truncated from the first space

PostPosted: Mon May 02, 2016 10:07 am
by TheWaldorfer
Code: Select allwget("192.168.178.23/esp/pin.php?Action=Message&mfrom=" & dev & "&mto=System&mtype=1&mess=Door/Window opened")


will truncate then parameters from the space after "...Window", so " opened" will not be transmitted.

Code: Select allwget("192.168.178.23/esp/pin.php?Action=Message&mfrom=" & dev & "&mto=System&mtype=1&mess=Door/Window_opened")


works.

Bug or feature?

Re: wget() parameters truncated from the first space

PostPosted: Mon May 02, 2016 10:18 am
by cicciocb
It's probably a feature :D

Re: wget() parameters truncated from the first space

PostPosted: Mon May 02, 2016 12:12 pm
by martinayotte
Spaces are one among the illegal characters in URLs, it needs to be escaped.
(This is not ESP related, but true for any HTTP requests)
http://www.w3schools.com/tags/ref_urlencode.asp

Re: wget() parameters truncated from the first space

PostPosted: Mon May 02, 2016 12:51 pm
by thelazyone
TheWaldorfer what version of ESP Basic you use ?

In latest (A20) (edit. A21 didnt fix it)
Code: Select allwget("192.168.178.23/esp/pin.php?Action=Message&mfrom=&mto=System&mtype=1&mess=Door/Window_opened")

gives me
Failed to reach end of input expression, likely malformed input


Variable Dump: shows
wget("192.168.178.23/esp/pin.ph = error


wget(string) also aint working, but without Variable Dump: error

If i remove
Code: Select all=
wget("192.168.178.23/esp/pin.php?ActionxMessage&mfromx&mtoxSystem&mtypex1&messxDoor/Window_opened")


i get no error, but also no conection, ESP's diode aint blinking when wget().

PS.
My first post so Hello Everybody,
ESP8266 BASIC is great, reeeealy good work