Web Connection User Discussions
data-raw
Hi Rick,
I need to embed this instruction as a cURL in a request:
--data-raw '<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
<d:prop>
<d:getlastmodified />
<d:getetag />
<d:getcontenttype />
<d:resourcetype />
<oc:fileid />
<oc:permissions />
<oc:size />
<d:getcontentlength />
<nc:has-preview />
<oc:favorite />
<oc:comments-unread />
<oc:owner-display-name />
<oc:share-types />
</d:prop>
</d:propfind>'
So, here his my code (XML instructions are in the NextCloud.xml file)
loHTTP = CREATEOBJECT ('wwHTTP')
loHTTP.Addheader("OCS-APIRequest", "true")
loHTTP.Addheader("Authorization", "Basic " + Base64 ("login:mdp"))
loHttp.cContentType = "text/xml"
loHTTP.AddPostKey(FILETOSTR ("c:\temporaire\NextCloud.xml"))
loHTTP.cHTTPverb = "PROPFIND"
Mreponse = loHTTP.HTTPget('https://cloud...)
The XML instructions of my request seem to be totally ignored. Where did I go wrong?
Thanks in advance
In cURL, it's works :
curl -u login:password -X PROPFIND -H "Content-Type: text/xml" --data-binary "@c:\temporaire\NextCloud.xml" "https://cloud.../Test.odt"
PROPFIND
is not a valid HTTP verb - I'd guess that's why it's failing. I'd guess it's POST
.
You should check what comes back from the server - http response, and status code.
+++ Rick ---