I am trying to send an iCalendar to webpage but when I send it there is no line separation and it is not considered as correct iCalendar format. If I send iCalendar format its just JSON format. And if its calendar.toString()
there is no line separation. How can I send it in correct format?
Calendar calendar = iCalendarService.getCalendar();
System.out.println(calendar); //Correct format in console
return ResponseEntity.ok(calendar.toString()); //No line separation
//return ResponseEntity.ok(calendar); // Json