Web Connection User Discussions
data-raw
Gravatar is a globally recognized avatar based on your email address. data-raw
  Vincent H.
  All
  Dec 18, 2021 @ 12:40am

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

Gravatar is a globally recognized avatar based on your email address. re: data-raw
  Vincent H.
  Vincent H.
  Dec 18, 2021 @ 01:45am

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"

Gravatar is a globally recognized avatar based on your email address. re: data-raw
  Rick Strahl
  Vincent H.
  Dec 18, 2021 @ 03:40pm

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 ---

Gravatar is a globally recognized avatar based on your email address. re: data-raw
  Vincent H.
  Rick Strahl
  Dec 19, 2021 @ 01:35am

Thanks, I think I had a cache memory problem ... It works now!

I confirm that the verb PROPFIND is correctly interpreted by my Webdav server which returns the properties of the file

© 1996-2022