function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ManojKumar MuthuManojKumar Muthu 

How to add new line space between fields while sending via rest api

Hi There,

Is there a way to add line space between fields while send via rest api??
below the apex class I use to send data to my front end

@RestResource(urlMapping='/EmailMessages/*')
global with sharing class EmailMessages{

@HttpGet
    global static List<EmailMessage> getCaseById() {
       RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        String Id = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
          List<EmailMessage> result =  [Select Id, Status, Headers, Subject, FromName, HtmlBody, Incoming, ParentId, TextBody, CcAddress, IsDeleted, ToAddress, ActivityId, BccAddress, CreatedById, CreatedDate, FromAddress, MessageDate, RelatedToId, HasAttachment, SystemModstamp, ThreadIdentifier, MessageIdentifier, IsExternallyVisible, ValidatedFromAddress, ReplyToEmailMessageId From EmailMessage where ParentId = :ID];
        return result;
    }
}

Expect Out:
donotreply@mcafee.comWed, Oct 10, 10:17 PM
to me
Dear McAfee Subscriber,

Thank you for activating your McAfee® security software.  You are now entitled to updates and upgrades for your McAfee products.
We’ve created your McAfee account with the email address you provided when you first set up your PC. 

But Actual Out is;
donotreply@mcafee.com Wed, Oct 10, 10:17 PM to me Dear McAfee Subscriber, Thank you for activating your McAfee® security software. You are now entitled to updates and upgrades for your McAfee products. We’ve created your McAfee account with the email address you provided when you first set up your PC. Next steps

Can someone help me on this.

TIA