2005-08-11 Web

Writing a WebDAV client using CGI only. The first question is: Will calling methods other than GET, POST and HEAD work?

Here’s a test script:

#!/usr/bin/perl
use CGI;
print "Content-type: text/plain\n\n";
$q = new CGI;
print $q->request_method, "\n";

Here’s how you connect:

→ alex@alpinobombus:~% telnet localhost 80<*code>*

The server responds:

Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

Now use some weird method:

→ FOO _cgi-bin_methods HTTP/1.0<*code>*

And you get the response showing that the CGI script was called with the appropriate method:

HTTP/1.1 200 OK
Date: Thu, 11 Aug 2005 00:19:25 GMT
Server: Apache/1.3.33 (Darwin)
Connection: close
Content-Type: text/plain

FOO
Connection closed by foreign host.

​#Web ​#WebDAV