Problem Sending Data to Parse (Facebook)

Hi All!!

I have had some problems when I am trying to send Data to Parse.
I already send and update data but only when I use numbers in a char[]
Something like this works perfectly.

char n1[40] = "20";
char n2[40] = "100";
sprintf(resultStr, "{\"n1\": %s, \"n2\": %s}", n1, n2);

But if i change, for example:

char n1[40] = "A";

I get a blank space on Parse, i don’t know why with letters it is not working.

I need the photonID and other parameters that use letters.
I tried using String and converting to char.

String id = "30032001047343432313031";
id.c_str()

And using sprintf again, but it’s the same i just get blank spaces.

And just with one parameter that contains a letter, although the other has numbers i get nothing.

Somebody with the same problem?

Let me know
Thanks in advance…

I’d suspect Parse to expect strings (and even HEX literals will be considered as strings) to be wrapped in double quotes.
So try

// format: {"n1":"<n1>","n2":"<n2>"}
sprintf(resultStr, "{\"n1\":\"%s\",\"n2\":\"%s\"}", n1, n2);

Reason: Strings could contain any of sort of delimiters, so the parsing process has to be informed to not treat delimiter characters when they are inside a double-quote-combo.

1 Like

I will try and let you know.
Thanks a lot…