|  |      1aonshuy      2020-12-06 18:31:41 +08:00  5 | 
|  |      3justin2018      2020-12-06 18:36:06 +08:00 https://curl.trillworks.com/ import requests headers = { 'Content-Type': 'text/xml', 'Depth': '1', } data = { '<propfind xmlns': '\'DAV:\'><prop><calendar-data xmlns=\'urn:ietf:params:xml:ns:caldav\'/></prop></propfind>' } response = requests.post('https://myserver/joe/home/', headers=headers, data=data, auth=('login', '')) | 
|  |      4ysc3839      2020-12-06 18:37:12 +08:00 via Android | 
|  |      5no1xsyzy      2020-12-06 18:54:11 +08:00  3 | 
|  |      6imn1 OP @no1xsyzy #5 没搜到 py3 可用的 carddav,caldav 那个还好,只是它仅有 caldav,代码看得有点晕,想继成过来兼容 carddav 没搞定 只是我需求没那么复杂,自用不需要理会各种 rfc 标准,分析出字段能读能写就行,requests + vobject 就够了 | 
|  |      7vone      2020-12-06 23:40:16 +08:00  1 你命令里的 "-u login" 不知道为什么被 postman 忽略了,改为 "-u login:",然后导入 postman,然后生成代码如下: import requests url = "https://myserver/joe/home/" payload="<propfind xmlns='DAV:'><prop><calendar-data xmlns='urn:ietf:params:xml:ns:caldav'/></prop></propfind>" headers = { 'Content-Type': 'text/xml', 'Depth': '1', 'Authorization': 'Basic bG9naW46' } response = requests.request("PROPFIND", url, headers=headers, data=payload) print(response.text) postman 导入方式:主界面=> Import => Raw text => Continue 。 https://i.loli.net/2020/12/06/5gvcKAYo1qEhrHR.jpg https://i.loli.net/2020/12/06/9m4abLBcCuysv1W.jpg | 
|      8WordTian      2020-12-07 01:41:23 +08:00 via Android WEBDAV 是 HTTP 的协议扩展,requests 是 http 的库,理论上应该不支持的吧 |