NextCloud PROPFIND returns always "[400] Document is empty on line 1, column 1" when sending anything in body with a "Make an API call"

Hi,

I’m trying to make working ANY call to NextCloud API that has anything in the body of a call.
When I’m using PROPFIND method to call my NextCloud without any parameters in the body
it returns properly list of files and folders in my folder.


As I need to get fileid property of each element so I’m trying to add parameters to the body of the call.
According to the NextCloud API manual Basic APIs — Nextcloud latest Developer Manual latest documentation
the body should be an xml, like one below (example from the nextcloud dev manual):

<?xml version="1.0" encoding="UTF-8"?>
<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
  <d:prop>
    <d:getlastmodified/>
    <d:getcontentlength/>
    <d:getcontenttype/>
    <oc:permissions/>
    <d:resourcetype/>
    <d:getetag/>
  </d:prop>
</d:propfind>

However, when I send this (with header Content-Type changed to application/xml - although it doesn’t matter)

I ALWAYS get “RuntimeError [400] Document is empty on line 1, column 1”

I’ve tried to put there anything really and test the response, but it doesn’t change. I’ve change content to json - still the call answer is the same.
I’ve tested the request with CURL and it works properly. I would do the call with HTTP module, but it doesn’t allow PROPFIND method.

In the end it seems to me that the implementation of this module in MAKE.COM is incorrect/not working properly.

Unless anyone can point me to a working example?

Thanks!
Jacek

I’ve found out that MAKE.COM sends “distorted” body with those requests: it adds quotation marks around the requests making it non-parsable.
For example simple CURL
curl ‘my-server’ -H “authorization: Basic …” --request PROPFIND --data “<d:propfind xmlns:d=‘DAV:’ xmlns:oc=‘http://owncloud.org/ns’ xmlns:nc=‘Nextcloud - Open source content collaboration platform’></d:propfind>”

is received as
–41883071-C–
<d:propfind xmlns:d=‘DAV:’ xmlns:oc=‘http://owncloud.org/ns’ xmlns:nc=‘Nextcloud - Open source content collaboration platform’></d:propfind>
–41883071-F–

But sending the same payload via MAKE.COM is received as
–7e088924-C–
“<d:propfind xmlns:d=‘DAV:’ xmlns:oc=‘http://owncloud.org/ns’ xmlns:nc=‘Nextcloud - Open source content collaboration platform’></d:propfind>”
–7e088924-F–

on which NextCloud xml parser throws error…