Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP OPTIONS sometimes does not work  RSS feed

 
Ryan McClain
Ranch Hand
Posts: 153
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The HTTP OPTIONS query does not seem to work on some hosts and I do not know why.

On some hosts, I can do the following:

OPTIONS /abc/abc.htm HTTP/1.1
Host: www.host.com

and as output from the server I get:

200 OK
Allow: OPTIONS, PUT, HEAD, TRACE

However, on other servers when I try this very same OPTIONS query,
either with * or /path/name.ext, the server sends me 'Connection: closed' back as attribute in the header (amongst others).
Why does one host perfectly give me its OPTIONS and another host does not?
Does this have to do with possible set up proxies on the host? I even tried HTTP/1.0.

Thanks
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The HTTP specification requires a server to support the GET and HEAD methods, but all other methods -like OPTIONS- are optional: http://tools.ietf.org/html/rfc2616#section-5.1.1. So it can indeed vary from server to server.
 
Adam Richards
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow. Optional options. LIfe just doesn't get any better than that
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Life just doesn't get any better than that

You're easily pleased :-)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!