XMLHttpRequestã§WebDAV
XMLHttpRequestã§WebDAVãã¤ãããã£ã½ãã
WebDAVããµãã¼ããã¦ãããªã³ã©ã¤ã³ãã¡ã¤ã«ã¹ãã¬ã¼ã¸ãããã°ãHTMLãç½®ãã ãã§ãã¡ã¤ã«ãã©ã¦ã¶ã¨ãã¦ã使ããã
var req = createXMLHttpRequest(); req.onreadystatechange = function() { if (req.readyState == 4) { if (req.status==207) { //... } } }; req.open('PROPFIND', '/', true); req.setRequestHeader('Depth', '1'); req.send('<?xml version="1.0" ?><propfind xmlns="DAV:"><allprop/></propfind>');
PROPFINDãªã¯ã¨ã¹ãã®çµæã¨ãã¦ããã£ã¬ã¯ããªã®ä¸èº«ã®XMLã¬ã¹ãã³ã¹ãè¿ã£ã¦æ¥ãã
ä¾ï¼
<?xml version="1.0" encoding="utf-8"?> <D:multistatus xmlns:D="DAV:" xmlns:ns0="DAV:"> <D:response xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/"> <D:href>/</D:href> <D:propstat> <D:prop> <lp1:resourcetype><D:collection/></lp1:resourcetype> <lp1:creationdate>2006-08-18T17:47:26Z</lp1:creationdate> <lp1:getlastmodified>Fri, 18 Aug 2006 17:47:26 GMT</lp1:getlastmodified> <lp1:getetag>"118012-1000-5a772780"</lp1:getetag> <D:getcontenttype>text/html</D:getcontenttype> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> </D:response> <D:response xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/"> <D:href>/js/</D:href> <D:propstat> <D:prop> <lp1:resourcetype><D:collection/></lp1:resourcetype> <lp1:creationdate>2006-08-18T17:43:02Z</lp1:creationdate> <lp1:getlastmodified>Fri, 18 Aug 2006 17:43:02 GMT</lp1:getlastmodified> <lp1:getetag>"118018-1000-4abad580"</lp1:getetag> <D:getcontenttype>httpd/unix-directory</D:getcontenttype> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> </D:response> <D:response xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/"> <D:href>/index.html</D:href> <D:propstat> <D:prop> <lp1:resourcetype/> <lp1:creationdate>2006-08-18T12:19:01Z</lp1:creationdate> <lp1:getcontentlength>5046</lp1:getcontentlength> <lp1:getlastmodified>Fri, 18 Aug 2006 12:19:01 GMT</lp1:getlastmodified> <lp1:getetag>"118016-13b6-c3f4b740"</lp1:getetag> <D:getcontenttype>text/html</D:getcontenttype> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> </D:response> </D:multistatus>
ãããresponseXMLãããã¼ã¿ãåãåºãã¦é©å½ã«HTMLã¬ã³ããªã³ã°ãããã¹ãã¼ã¿ã¹ã³ã¼ãã¯200ãããªãã£ã¦207ãªãã¨ã«æ³¨æã
XMLHttpRequestã¯åããã¡ã¤ã³å
ã§ãã使ããªããããJavaScriptãæ¸ããHTMLã¯åãWebDAVãµã¼ãã¹ã¹ãã¼ã¬ã¸ã«ãã¡ã¤ã«ã¨ãã¦ç½®ãã¦ãããã¨ã«ãªãã
WebDAVãèªè¨¼ãå¿
è¦ã¨ãã¦ãã¦ãããããããHTMLãã¼ãæã«ãã°ã¤ã³ããã¦ããã°ãXMLHttpRequestãã³ã¼ã«ãããã³ã«èªè¨¼ãåã³èããããã¨ã¯ãªãã
PROPFINDã ããããªããPUTãDELETEãªã©ã®æ´æ°ç³»æä½ãå¯è½ãç°¡æã¡ã¢ãããã®ã¢ããªãªã楽ã«ä½ããããã
ã¡ãªã¿ã«WebDAVç°å¢ã¯ãã¡ãã§è©¦ãã¾ããã
http://www.freedav.com