Skip to content

Instantly share code, notes, and snippets.

@Phaiax
Created January 7, 2020 15:29
Show Gist options
  • Save Phaiax/1b186336eb3c6d457705a1564ed112a4 to your computer and use it in GitHub Desktop.
Save Phaiax/1b186336eb3c6d457705a1564ed112a4 to your computer and use it in GitHub Desktop.
Webdav curl tests
curl -X HEAD -v --user 'myuser:mypw' 'http://192.168.0.12:5005/ExistingFolder/' --basic
Warning: Setting custom HTTP method to HEAD with -X/--request may not work the
Warning: way you want. Consider using -I/--head instead.
* Trying 192.168.0.12...
* TCP_NODELAY set
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 192.168.0.12 (192.168.0.12) port 5005 (#0)
* Server auth using Basic with user 'myuser'
> HEAD /ExistingFolder/ HTTP/1.1
> Host: 192.168.0.12:5005
> Authorization: Basic ZGFuaWVsOmxlaW5hZA==
> User-Agent: curl/7.56.1
> Accept: */*
>
< HTTP/1.1 403 Forbidden
< Date: Tue, 07 Jan 2020 15:24:41 GMT
< Server: Apache
< Content-Type: text/html; charset=iso-8859-1
* no chunk, no close, no size. Assume close to signal end
<
0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0{ [0 bytes data]
0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0
* Closing connection 0
$ curl -v -X PROPFIND --header 'Depth:0' --user 'myuser:mypw' 'http://192.168.0.12:5005/ExistingFolder' --basic
* Trying 192.168.0.12...
* TCP_NODELAY set
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 192.168.0.12 (192.168.0.12) port 5005 (#0)
* Server auth using Basic with user 'myuser'
> PROPFIND /ExistingFolder HTTP/1.1
> Host: 192.168.0.12:5005
> Authorization: Basic ZGFuaWVsOmxlaW5hZA==
> User-Agent: curl/7.56.1
> Accept: */*
> Depth:0
>
< HTTP/1.1 207 Multi-Status
< Date: Tue, 07 Jan 2020 15:26:54 GMT
< Server: Apache
< Location: http://192.168.0.12:5005/ExistingFolder/
< Content-Length: 828
< Content-Type: application/xml; charset="utf-8"
<
{ [828 bytes data]
100 828 100 828 0 0 828 0 0:00:01 --:--:-- 0:00:01 8903<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:">
<D:response xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/">
<D:href>/ExistingFolder/</D:href>
<D:propstat>
<D:prop>
<lp1:resourcetype><D:collection/></lp1:resourcetype>
<lp1:creationdate>2017-11-23T08:38:00Z</lp1:creationdate>
<lp1:getlastmodified>Fri, 20 Dec 2019 12:10:54 GMT</lp1:getlastmodified>
<lp1:getetag>"9460001-1000-59a2191d733fb"</lp1:getetag>
<D:supportedlock>
<D:lockentry>
<D:lockscope><D:exclusive/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>
<D:lockentry>
<D:lockscope><D:shared/></D:lockscope>
<D:locktype><D:write/></D:locktype>
</D:lockentry>
</D:supportedlock>
<D:getcontenttype>httpd/unix-directory</D:getcontenttype>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>
* Connection #0 to host 192.168.0.12 left intact
$ curl -v -X PROPFIND --header 'Depth:0' --user 'myuser:mypw' 'http://192.168.0.12:5005/NotExistingFolder' --basic
* Trying 192.168.0.12...
* TCP_NODELAY set
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 192.168.0.12 (192.168.0.12) port 5005 (#0)
* Server auth using Basic with user 'myuser'
> PROPFIND /NotExistingFolder HTTP/1.1
> Host: 192.168.0.12:5005
> Authorization: Basic ZGFuaWVsOmxlaW5hZA==
> User-Agent: curl/7.56.1
> Accept: */*
> Depth:0
>
< HTTP/1.1 405 Method Not Allowed
< Date: Tue, 07 Jan 2020 15:26:37 GMT
< Server: Apache
< Allow: POST,OPTIONS,GET,HEAD
< Content-Length: 234
< Content-Type: text/html; charset=iso-8859-1
<
{ [234 bytes data]
100 234 100 234 0 0 234 0 0:00:01 --:--:-- 0:00:01 2489<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>405 Method Not Allowed</title>
</head><body>
<h1>Method Not Allowed</h1>
<p>The requested method PROPFIND is not allowed for the URL /NotExistingFolder.</p>
</body></html>
* Connection #0 to host 192.168.0.12 left intact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment