I’m trying to grab a list of files/folders from Box.net using WebDAV (https://box.com/dav).
However, even though I’m constructing (what I think is) a valid WebDAV PROPFIND request. The data is coming back from Box in HTML format.
I was expecting something like this:
http://www.webdav.org/specs/rfc2518.html#rfc.section.8.1.2
But, it comes back list this:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Box WebDAV list</title>
</head>
<body>
<p>
<a href="http://www.box.com/dav/A%20Test.pdf">A Test.pdf</a>
</p>
<p>
...
Am I doing something wrong, or is this a valid WebDAV response?
I’d much rather get back in the WebDAV format I’ve currently handled rather than custom parse it, but can do so if necessary.
Try issuing your PROPFIND request to https://www.box.com/dav
I suspect by issuing it to https://box.com/dav you’re getting a 301 redirect that your client is then turning into a GET request which will result in the HTML output you’re seeing