Hi,
I attempted to return plain text content in Cloud Code. However, It seems to return as a JSON-escaped string.
In fact, this was only the first step into trying to set up icalendar content. So eventually I would like to return “text/calendar” content, but first I tried “text/plain” and I do not seem to be getting anywhere.
Here is what I have “coded” in Codeless:
The response when invoked seems OK:
However, when called in the browser, here is the response:
"BEGIN:VCALENDAR\nVERSION:2.0\nBEGIN:VEVENT\nCLASS:PUBLIC\nDESCRIPTION:We will have fun\nLOCATION:Here at R4S\nSUMMARY:Test Event R4S\nTRANSP:TRANSPARENT\nDTSTART:20220406T151800Z\nDTEND:20220406T161500Z\nEND:VEVENT\nEND:VCALENDAR\nUID:i5ikfjsqi5\nDTSTAMP:20220402\nPRODID:datebook.dev\n"
Note the extra "
at the very beginning and the very end, as well as the escaped newline characters.
Wondering if it was the request which was wrong, I tried modifying the Accept
and Content-Type
parameters, but nothing changed :
So I’m guessing there is somewhere I need to set up the Cloud Code API route so as to simply return the Codeless string output, without JSON-escaping it. I haven’t found anything in the documentation or support forums.
Could someone point me in the right direction please ? Thanks !