This may be a common question, so sorry if this has been asked before. In my app, I send data to a database using the PostString command, like this:
This all works fine with the comma splitting up my parameters in Params. However, I need to send some data in the Params parameter that contains a comma, like this:
In the example above, there is just one parameter in Params: "Param3, is a good parameter", but my .aspx code will see the comma in it and see it as two parameters. I could do something more unique, like creating another URL parameter, like &Params1 and &Params2, and not use a comma, but then the problem becomes what happens when there is an ampersand in the data.
The best solution I've found so far is to, for example, replace the comma with %2c in the URL and then, on the webserver side, replace %2c back to a comma. I don't like this solution, but it seems viable. Before I committed to that, though, I was wondering if there is anything in B4X that might do a URL rewriting job, or if anyone has a suggestion for a better way to accomplish this.
B4X:
Dim MyHttpJob As HttpJob
MyHttpJob.PostString("http://www.mywebsite.com/webinterface.aspx?ID=0&Params=Param1,Param2", "Jobname")
B4X:
Dim MyHttpJob As HttpJob
MyHttpJob.PostString("http://www.mywebsite.com/webinterface.aspx?ID=0&Params=Param3, is a good parameter.", "Jobname"))
The best solution I've found so far is to, for example, replace the comma with %2c in the URL and then, on the webserver side, replace %2c back to a comma. I don't like this solution, but it seems viable. Before I committed to that, though, I was wondering if there is anything in B4X that might do a URL rewriting job, or if anyone has a suggestion for a better way to accomplish this.