Nickle Member Licensed User Longtime User Nov 22, 2012 #1 I am grateful for the response on my last post, my issue was resolved. Now I am passing values to a webservice url. one of the variables forming the request sometimes contains special characters or spaces which distorts the http request i am passing. I need help to encode/decode the content am passing in the request. The web service is created from php code. The variable which sometimes contains the special characters is xbody as can be seen in the request below line of code. Code: ExecuteRemoteQuery("http://localhost:10088/Countries/collector.php?xaddress="&xaddress&"&xbody="&xbody&"&smsread="&smsread&"&smsdate="&smsdate&"&smstime="&smstime&"&msgid="&msgid,1)
I am grateful for the response on my last post, my issue was resolved. Now I am passing values to a webservice url. one of the variables forming the request sometimes contains special characters or spaces which distorts the http request i am passing. I need help to encode/decode the content am passing in the request. The web service is created from php code. The variable which sometimes contains the special characters is xbody as can be seen in the request below line of code. Code: ExecuteRemoteQuery("http://localhost:10088/Countries/collector.php?xaddress="&xaddress&"&xbody="&xbody&"&smsread="&smsread&"&smsdate="&smsdate&"&smstime="&smstime&"&msgid="&msgid,1)
NJDude Expert Licensed User Longtime User Nov 22, 2012 #2 Search for the StringUtils library, that will allow you to URLEncode/Decode. Upvote 0
warwound Expert Licensed User Longtime User Nov 23, 2012 #3 Best to use the StringUtils encode method. It'll properly encode all special characters in a way that is compatible with the PHP urldecode function. Be sure to only encode the GET key names (probably not required) and key values - don't use StringUtils to encode the entire URL or it won't work. Martin. Upvote 0
Best to use the StringUtils encode method. It'll properly encode all special characters in a way that is compatible with the PHP urldecode function. Be sure to only encode the GET key names (probably not required) and key values - don't use StringUtils to encode the entire URL or it won't work. Martin.
Erel B4X founder Staff member Licensed User Longtime User Nov 23, 2012 #4 You can also use HttpUtils2 instead of HttpClient. You can then call HttpJob.Download2. It will take care of encoding the URL parameters. Upvote 0
You can also use HttpUtils2 instead of HttpClient. You can then call HttpJob.Download2. It will take care of encoding the URL parameters.