Edited Propfind to return fileid

This commit is contained in:
Lisa-Hoffmann
2022-01-06 00:26:35 +01:00
committed by GitHub
parent 1bbfad265b
commit 7461c98286
+3 -1
View File
@@ -5,7 +5,9 @@ import sys
# Prepare and send the propfind request return xml string
def propfind(path,auth):
headers = {"Depth":"1"}
req = r = requests.Request("PROPFIND", path, headers=headers, auth=auth)
# This body returns only the timelastmodified and the fileid variable
data = "<d:propfind xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\">"+"<d:prop>"+"<d:getlastmodified />"+ "<oc:fileid />"+"</d:prop>"+"</d:propfind>"
req = r = requests.Request("PROPFIND", path, headers=headers, auth=auth, data=data)
prepped = req.prepare()
s = requests.Session()