Newline Character "\n" parsing problem in webhooks

Newline Character "\n" parsing problem in webhooks

Hi there, I am facing an issue in Zoho Flow (maybe a general issue or maybe only in Zoho Flow):

I have this function:
  1. void sendListWebhook(string url, list array) 
  2. {
  3. for each  arrayElement in array
  4. {
  5. result = invokeurl
  6. [
  7. url :url
  8. type :POST
  9. parameters:arrayElement.toString()
  10. content-type:"application/json"
  11. ];
  12. }
  13. }

The array in this case is the lineItems of a Zoho Books SalesOrder, although it could be anything else. The url is a webhook endpoint of another Zoho Flow Workflow. If the JSON string contains "\n", the webhook payload in the other Zoho Flow Workflow is empty. But if I replace all newline characters:
  1. parameters:arrayElement.toString().replaceAll("\n"," - ",true);
it works as expected and the webhook payload is filled with the data.

I am not sure if this is a general problem with invokeurl or a problem with the parsing of JSON in Zoho Flow Webhooks.

For the record, here is one of the JSON payloads which are not working (I stripped all the other parameters without a "\n" for privacy and better readability):
  1. {"description":"My Test Description\n\nAnd here my new line.","otherField":"otherValue"}