适用于iCloud的CalDav客户端:MKCOL失败,出现412个先决条件失败 [英] CalDav Client for iCloud: MKCOL fails with 412 precondition failed

查看:456
本文介绍了适用于iCloud的CalDav客户端:MKCOL失败,出现412个先决条件失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助。
我在我们的系统上实现了CalDav客户端,它就像一个魅力。现在,在iCloud上创建新日历时遇到一些问题。也许有些人知道我该如何解决。



当前我收到412错误。



标题:

 深度:1 
内容类型:application / xml; charset = UTF-8
$ b $ User-Agent:DAVKit / 4.0.1(730); CalendarStore / 4.0.1(973); iCal / 4.0.1(1374); Mac OS X / 10.6.2(10C540)`

请求:

 `MKCOL` 

正文:

 < D:mkcol xmlns:D = DAV: xmlns:C = urn:ietf:params:xml:ns:caldav> 
< D:set>
< D:prop>
< D:resourcetype>
< D:collection />
< C:calendar-collection />
< / D:资源类型>
< D:displayname>某些名称< / D:displayname>
< / D:prop>
< / D: set>
< / D:mkcol>`

URL:



https://caldav.icloud.com/1722222111/calendars/64DA8FE9D95A40E4B83A45B47DEC6C53/



URL是我的原则(我当然更改过),并且是日历资源的随机生成的UUID。



也许有人发现任何错误? b过去6个月前运行良好。



非常感谢!

解决方案

虽然 caldav.icloud.com 终结点上似乎存在映射错误(如果要引用,则称为Radar 46258347),则您不是应该首先在此终结点上命中 / calendars URL。



您仅使用 caldav.icloud.com 发现主体资源(代表用户/ ac计数)。这包含托管您帐户的caldav服务器的实际分区,如下所示:

  https://pXX-caldav.icloud .com / asdfjasdjkjfd / calendars / 

这些端点似乎仍然可以正常工作(只是尝试过)。 / p>

那么您如何从 caldav.icloud.com 到实际的CalDAV服务器?您需要获取 calendar-home-set 属性。



整个过程在CalDAV RFC或此不错的指南中进行了描述:
http://sabre.io/dav/building-a-caldav-client/#发现


I need help. I implemented a CalDav Client on our System and it worked like a charm. Now I have some problems with creating new calendars on iCloud. Maybe some of you know how I can fix this.

Currently I get a 412 Error.

Headers:

"Depth: 1"
"Content-Type: application/xml; charset=UTF-8"
"User-Agent: DAVKit/4.0.1 (730); CalendarStore/4.0.1 (973); iCal/4.0.1 (1374); Mac OS X/10.6.2 (10C540)"`

Request:

`MKCOL`

Body:

    <D:mkcol xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"> 
    <D:set>
      <D:prop>
        <D:resourcetype>
          <D:collection/>
          <C:calendar-collection/>
       </D:resourcetype>"
       <D:displayname>some name</D:displayname>
      </D:prop>
    </D:set>
    </D:mkcol>`

URL:

https://caldav.icloud.com/1722222111/calendars/64DA8FE9D95A40E4B83A45B47DEC6C53/

The URL ist my Principle (I changed it of course) and a randomly generated UUID for the calendar resource.

Maybe somebody spots any errors? Used to work fine 6 months ago.

Thank you very much!

解决方案

While there seems to be a mapping bug on the caldav.icloud.com endpoint (filed that as Radar 46258347 if you want to refer), you are not supposed to hit a /calendars URL on this endpoint in the first place.

You only use caldav.icloud.com to discover the principal resource (representing the user/account). This contains the actual partition hosting the caldav server for your account, it looks like:

https://pXX-caldav.icloud.com/asdfjasdjkjfd/calendars/

Those endpoint still seem to work just fine (just tried).

So how do you get from caldav.icloud.com to the actual CalDAV server? You need to retrieve the calendar-home-set property of the principal.

The whole process is described in the CalDAV RFC or in this nice guide: http://sabre.io/dav/building-a-caldav-client/#discovery.

这篇关于适用于iCloud的CalDav客户端:MKCOL失败,出现412个先决条件失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆