I have a JSON object structured like this:
{
"name": "ok",
"country": "US",
"phone": "900",
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1f70745f727e767331707c">[email protected]</a>",
"time": "21:00"
}
My goal is to convert it into a string that looks similar to the following example:
"{\n \"name\": \"ok\",\n \"country\": \"US\",\n \"phone\": \"900\",\n \"email\": \"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1b74705b767a7277357478">[email protected]</a>\",\n \"time\": \"21:00\",\n \"sendData\": \"300\"\n}"
I attempted using JSON.stringify(); however, it did not produce the expected result. Is there a simple way to achieve this? Any assistance would be greatly appreciated.