Wednesday, November 05, 2008

HTTP Protocol: Method OPTIONS?

Well, the method OPTIONS defined in HTTP RFC[1] is required to be implemented for all web servers. [2]

But when I test it with my local apache server and the bckids.info server, something looks interesting...

1. Trying http/1.0 shows the methods allowed together with error 501.

calvin:~ cxl$ telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
options * http/1.0

HTTP/1.1 501 Method Not Implemented
Date: Wed, 05 Nov 2008 22:26:33 GMT
Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7l DAV/2 PHP/5.2.6
Allow: GET,HEAD,POST,OPTIONS,TRACE
Content-Length: 209
Connection: close
Content-Type: text/html; charset=iso-8859-1


2. Trying http/1.1 shows error 400: Bad Request.

calvin:~ cxl$ telnet localhost 80
Trying ::1...
Connected to localhost.
Escape character is '^]'.
options * http/1.1

HTTP/1.1 400 Bad Request
Date: Wed, 05 Nov 2008 22:26:06 GMT
Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7l DAV/2 PHP/5.2.6
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1


[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1
[2] http://en.wikipedia.org/wiki/HTTP

No comments: