putUtfString strips characters from string
putUtfString strips characters from string
When I try to add the text string of a json to an SFSObject, the curly braces are stripped from both ends. How can I send a stringified json (actually the value of a textarea) from html5 client to server?
Re: putUtfString strips characters from string
Hi,
I am not sure I am getting this right: you're expecting JSON code to be input in the text area and you want to send that text representing the JSON?
Is it correct?
Thanks
I am not sure I am getting this right: you're expecting JSON code to be input in the text area and you want to send that text representing the JSON?
Is it correct?
Thanks
Re: putUtfString strips characters from string
Someone will paste the text of a json into a textarea and the value of that textarea is sent to the server. I have checked and the value of the text area is extracted correctly but .putUtfString into an object strips the curly braces.
Re: putUtfString strips characters from string
How did you verify that the curly braces are lost in the SFSObject string?
Did you send the SFSObject to the server?
Did you send the SFSObject to the server?
Re: putUtfString strips characters from string
I did a console.log(sParams.getDump()) before sending to server
Re: putUtfString strips characters from string
I imagined that.
The getDump() method uses curly braces internally as tokens to format the data, and that's the reason why the output doesn't match the expectations. But the data is untouched (of course) and when you send it to the other side it will arrive as expected.
We'll see if we can improve the getDump() method to avoid this corner case.
Cheers
The getDump() method uses curly braces internally as tokens to format the data, and that's the reason why the output doesn't match the expectations. But the data is untouched (of course) and when you send it to the other side it will arrive as expected.
We'll see if we can improve the getDump() method to avoid this corner case.
Cheers