Caldav access with curl

Hi,

I would like to try caldav with curl, but I got 501 reponse. Caldav enabled to my premium account…Anybody have experience with caldav in this manner?

Thanks!

BR,
Laszlo

Hello @atomanti ,

It’s difficult to say exactly why you’re getting a 501 error without seeing the curl request you tried, but I can provide an example of a successful CalDAV request that you can test.

The 501 Not Implemented error usually means the server doesn’t support the specific method or feature you are trying to use. The example below shows how you can get a list of events using a REPORT request, which is common in CalDAV.

Here is an example of how you could get a list of events:

$ curl -k -X REPORT \
-d '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>                                                                                              <sync-collection xmlns="DAV:">
    <prop xmlns="DAV:"><getetag xmlns="DAV:"/>
    </prop>
    <sync-token xmlns="DAV:">0</sync-token>
</sync-collection>' \
-H "Content-Type: application/xml" \
-u user.test@domain.tld:account-password \
https://axigen.webmail.url/Calendar/Calendar

producing an output like:

<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<A:multistatus xmlns:A="DAV:">

  <A:response>
    <A:href>/Calendar/Calendar/Calendar_76_16777219_1.ics</A:href>
    <A:propstat>
      <A:prop>
        <A:getetag>"ccfc89027253505649372858cb82ceba"</A:getetag>
      </A:prop>
      <A:status>HTTP/1.1 200 OK</A:status>
    </A:propstat>
  </A:response>

  <A:response>
    <A:href>/Calendar/Calendar/Calendar_76_16777219_2.ics</A:href>
    <A:propstat>
      <A:prop>
        <A:getetag>"ebb934779b5a5f4c55485414f951af31"</A:getetag>
      </A:prop>
      <A:status>HTTP/1.1 200 OK</A:status>
    </A:propstat>
  </A:response>

  <A:sync-token>http://m.tld/12884901891</A:sync-token>

</A:multistatus>

To help you further, please share the curl command that produced the 501 error, and I’ll try to take a look.

HTH,
Ioan