JSON Encoder
Posted: Sat Dec 16, 2023 11:12 am
Hi
There appears to be a small bug with the JSON Encoder component. I'm using the encoder to send to a PHP script. I checked the script by sending a string from a browser and I get the expected reply.
If I only have one element the encoder returns (for example) "{\"Name1\":\"Data1\"}" and I can send this off to the PHP script without any problem.
If I encode two elements it returns (for example) "{\"Name1\":\"Data1\", \"Name2\":\"Data2\"}" but this causes issues.
It appears that the problem is when encoding multiple "elements", the component inserts a space after the comma before the next element begins.
If I step through the chart and manually edit the string, e.g. "{\"Name1\":\"Data1\",\"Name2\":\"Data2\"}" removing the space after the comma, then the PHP script happily accepts.
Regards
There appears to be a small bug with the JSON Encoder component. I'm using the encoder to send to a PHP script. I checked the script by sending a string from a browser and I get the expected reply.
If I only have one element the encoder returns (for example) "{\"Name1\":\"Data1\"}" and I can send this off to the PHP script without any problem.
If I encode two elements it returns (for example) "{\"Name1\":\"Data1\", \"Name2\":\"Data2\"}" but this causes issues.
It appears that the problem is when encoding multiple "elements", the component inserts a space after the comma before the next element begins.
If I step through the chart and manually edit the string, e.g. "{\"Name1\":\"Data1\",\"Name2\":\"Data2\"}" removing the space after the comma, then the PHP script happily accepts.
Regards