Variables with comma in form field list in HTTP POST REQUEST

Post your questions and help other users.

Moderator: Martin

Post Reply
cauethenorio
Posts: 2
Joined: 13 Jan 2014 22:50

Variables with comma in form field list in HTTP POST REQUEST

Post by cauethenorio » 13 Jan 2014 23:03

Hi!
First thanks for this great APP!

I'm trying to make a POST HTTP REQUEST with a received SMS text, but it's breaking when the text have any comma.
Text example: "HI JOHN, DO YOU ARE THERE?"

when I make a HTTP POST with Form Field List:

Code: Select all

text={ sms_text }
I get this form fields in my web server:

Code: Select all

text=HI JOHN
DO YOU ARE THERE?=
It's using the comma inside the variable to split the fields.
There is a way to avoid this?

Thanks,

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Variables with comma in form field list in HTTP POST REQ

Post by Martin » 14 Jan 2014 17:37

Hi,

Using double quotes to enclose a value in a comma separated list should work:
Form Field List:
"text=Hi, are you there"

If you have multiple key-value-pairs in the list it would look like this:
"Key1=a,b,c","Key2=1,2,3"

Regards,
Martin

cauethenorio
Posts: 2
Joined: 13 Jan 2014 22:50

Re: Variables with comma in form field list in HTTP POST REQ

Post by cauethenorio » 07 Feb 2014 12:20

Thanks Martin! Works perfectly!

Post Reply