我正在尝试通过Python访问我的Fastmail日历。我按照this answer的建议使用了caldav模块。下面是我的代码:
def main():
auth = HTTPBasicAuth(username='mail@domain.com', 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='mail@domain.com', password='myapplicationpassword'),也得到了同样的结果。
最后,我看了一下caldav example using iCloud,并试图用快速邮件重现同样的想法。我也遇到了同样的问题(principal_response的状态码是404 )。
我遗漏了什么?
发布于 2020-03-03 09:30:08
正确的URL是https://caldav.fastmail.com/dav。从服务器和端口文档来看,这一点并不明显。
https://stackoverflow.com/questions/53029743
复制相似问题