views:

145

answers:

2

Note: I am new to Tomcat...

I am getting this message in the Tomcat localhost_access_log:

127.0.0.1 - - [09/Oct/2009:09:37:30 -0700] "OPTIONS /stl/foo HTTP/1.1" 200 -

Can anyone explain to me where the OPTIONS comes from? I am using a 3rd party library (DirectJngine) but in perusing the source I can't see any reference to this being set. The docs imply that it will always use GET or POST. Is OPTIONS some kind of default inside Tomcat?

The same log file shows a more normal looking GET when I do the same thing from a browser:

127.0.0.1 - - [09/Oct/2009:09:07:24 -0700] "GET /stl/foo HTTP/1.1" 500 1805

+1  A: 

That's the request coming from the client.

GET and POST aren't the only allowed requests. You might also see

  • OPTIONS
  • HEAD
  • PUT
  • DELETE
  • TRACE
  • CONNECT

http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

Jeremy Stein
+3  A: 

The OPTIONS method is a request from the client to the server asking about available transfer options, but without actually requesting the resource.

From the spec at http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

9.2 OPTIONS

The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.

It would appear your 3rd-party library is using the OPTIONS command prior to fetching the resource.

Jim Garrison