I’m trying to write a simple web app that will allow me to write some JSON inside of a textarea element and then POST it to my server. The problem that I am facing though is that when the JSON reaches the server, it contains all of the newlines from the textarea. This is a problem because now I can’t use JSON.parse, for example, to get it back into Javascript-land.
I have thought about just stripping newlines from it, on the server side, but is there some better way to actually send this as JSON perhaps?
JSON ignores most whitespace, except in the values.