I'm struggling with PostString to a php web service.
The problem is with the args parameter, which is a jason formatted string, such as:
data_arr(4) = ["Daniel Edward","941148000000","M",36,1389102979737]
In the php web service...
$args is now [\"Daniel Edward\",\"941148000000\",\"M\",36,1389102979737]
So the double quotes is escaped with the backslash.
I can add some code to fix $args, however what was sent is not what I get out the other side.
How should I do this? (I don't want to split args into separate post variables).
Thanks
John
B4X:
Dim post_params As String
Dim su As StringUtils
post_params = "device_id="& su.EncodeUrl(data_arr(0),"UTF8") & _
"&club_id=" & su.EncodeUrl(data_arr(1),"UTF8") & _
"&seq=" & su.EncodeUrl(data_arr(2),"UTF8") & _
"&str=" & su.EncodeUrl(data_arr(3),"UTF8") & _
"&args=" & su.EncodeUrl(data_arr(4),"UTF8")
send_job.PostString(linkstr, post_params)
data_arr(4) = ["Daniel Edward","941148000000","M",36,1389102979737]
In the php web service...
B4X:
$args = urldecode($_POST["args"]);
$args is now [\"Daniel Edward\",\"941148000000\",\"M\",36,1389102979737]
So the double quotes is escaped with the backslash.
I can add some code to fix $args, however what was sent is not what I get out the other side.
How should I do this? (I don't want to split args into separate post variables).
Thanks
John
Last edited: