使用Python访问Fastmail CalDAV

问题描述 投票:2回答:1

我正在尝试通过Python访问我的Fastmail日历。我正在使用caldav建议的this answer模块。这是我的代码如下所示:

def main():
    auth = HTTPBasicAuth(username='[email protected]', password='myapplicationpassword')
    client = caldav.DAVClient('https://caldav.fastmail.com', auth=auth)
    try:
        client.principal()
    except Exception as e:
        print(e)

[client.principal()引发异常:

404 Not Found

b'<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor="white">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n'

我也尝试过client = caldav.DAVClient('https://caldav.fastmail.com', username='[email protected]', password='myapplicationpassword'),并获得了相同的结果。

最后,我看了一下caldav example using iCloud,并尝试通过fastmail重现相同的想法。我遇到了同样的问题(principal_response的状态码为404)。

我想念什么?

python caldav
1个回答
0
投票

正确的URL是https://caldav.fastmail.com/dav。从服务器和端口文档中看不出来。

© www.soinside.com 2019 - 2024. All rights reserved.