Test webcal(iCalendar) url from local server

2.1k Views Asked by At

I made path in rails which generate .ics file for i calendar. How can i test that link from local server Here is how i generate .ics file on path(/api/calendar/):

  send_data cal.to_ical, filename: file_name, type: "text/calendar; charset=utf-8", disposition: 'attachment'
1

There are 1 best solutions below

0
On

This is what I do

To get the file use curl (on Linux, macOS or Windows 10)

curl -v http://localhost/api/calendar/file_name.ics

You will see

< HTTP/1.1 200 OK
< Date: Mon, 22 Jul 2019 17:52:59 GMT
< Server: Apache/2.4.18 (Ubuntu)
< Content-Length: 648
< Content-Type: text/calendar;charset=UTF-8
<
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
DTSTAMP:20190722T175259Z
SUMMARY:An Event
DTSTART:20190716T131500
DTEND:20190716T191500
END:VEVENT
...etc

You can save the ics file

curl http://localhost/api/calendar/file_name.ics -O

Try opening it in a calendar app like Mozilla Thunderbird, Apple Calendar or Outlook or import into Google Calendar or Outlook 365