405 Method Not Allowed when using Curl example from doc

Nextcloud version: 12.0.4
Operating system and version: WSL Ubuntu 16
Apache or nginx version: Apache 2.4.18
PHP version: 7.2

I’ve got a working Nextcloud installation. I can view the files in my browser and can connect to WebDav with Cyberduck.

However, when I try to run the Curl example from the doc, I’m getting an error “405 Method Not allowed” and indeed the PROPFIND method is not among the allowed methods.

$ curl -v -X PROPFIND -H "Depth: 1" -u admin:****** http://nextcloud.local/nextcloud/remote.php/dav/files/admin/
*   Trying
* Connected to nextcloud.local ( port 80 (#0)
* Server auth using Basic with user 'admin'
> PROPFIND /nextcloud/remote.php/dav/files/admin/ HTTP/1.1
> Host: nextcloud.local
> Authorization: Basic ********
> User-Agent: curl/7.47.0
> Accept: */*
> Depth: 1
< HTTP/1.1 405 Method Not Allowed
< Date: Fri, 19 Jan 2018 13:48:38 GMT
< Server: Apache/2.4.18 (Ubuntu)
< Content-Length: 344
< Content-Type: text/html; charset=iso-8859-1
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The requested method PROPFIND is not allowed for the URL /nextcloud/remote.php/dav/files/admin/.</p>
<address>Apache/2.4.18 (Ubuntu) Server at nextcloud.local Port 80</address>
* Connection #0 to host nextcloud.local left intact

Any idea what could be the issue? Are there some more headers that I need to provide to get it working? I see that Cyberduck is making PROPFIND requests without any problem so I’m most likely missing something.

For information, this is the kind of calls that CyberDuck makes and it works:

PROPFIND /remote.php/dav/files/admin/Documents/ HTTP/1.1
Depth: 1
Content-Type: text/xml; charset=utf-8
Content-Length: 242
Host: nextcloud.local
Connection: Keep-Alive
User-Agent: Cyberduck/ (Windows 10/10.0) (x86)
Cookie: cookie_test=test; nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; oc_sessionPassphrase=*****************
Accept-Encoding: gzip,deflate
Authorization: ********

You have to allow it for the URL. With curl, you weren’t using HTTPS, with Cyberdurck you perhaps did??

I found that the issue is that the PROPFIND call requires a request body. By providing one I could get it to work in Curl. So I guess the example in the documentation is not correct.

Please share this information in a bug report on https://github.com/nextcloud/documentation