这个命令用 requests 怎么写?
–data “<propfind xmlns=’DAV:’><prop><calendar-data xmlns=’urn:ietf:params:xml:ns:caldav’/></prop></propfind>”
https://myserver/joe/home/
谢了
谢了
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’, ”))
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