From: Minero Aoki Date: 2001-07-03T17:55:36+09:00 Subject: [ruby-talk:17179] Re: Question on Net::HTTP Hi Dave, In mail "[ruby-talk:17177] Question on Net::HTTP" Dave Thomas wrote: > Let's pretend I wanted to add additional requests so that I could send > (say) WEBDAV commands to an HTTP server. So, instead of sending the > traditional GETs and POSTs, I'd be sending PROPFINDs and MKCOLs. It > seems as if this is quite difficult given the current structure of the > Net::HTTP module: I have write code that makes assumptions about its > internal organization, calling def_http_method and defining the > appropriate subclasses. > > Am I misunderstanding this? Is there an easy way to add new request > types using published interfaces? I'm afraid there's no any ways. You can only creating subclass of HTTPRequest and def_http_method. If there's some method, i.e. Net::HTTP.define_new_http_method, which defines methods to handle new HTTP method, is it sufficient? Usage: Net::HTTP.defind_new_http_method 'Get', # request type false, # has request body true # has response body This method creats a new HTTP request class, setting it up properly, and define interface methods for Net::HTTTP. Minero Aoki