Net::HTTP

0 views
Skip to first unread message

doug

unread,
Dec 8, 2007, 10:12:06 PM12/8/07
to Ruby on Rails: Talk
The Net::HTTP class has a post_form method. However, if I create an
instance of that class (e.g., my_instance=Net::HTTP.new('url',port), I
can't seem to access the post_form method of the instance. (I would
expect that I would be able to access 'my_instance.post_form'). Can
anyone please tell me what I am missing? Thanks for any input.

... doug

Michael Guterl

unread,
Dec 9, 2007, 4:43:28 PM12/9/07
to rubyonra...@googlegroups.com
Hi,


>> Net::HTTP.instance_methods.grep(/post/)
=> ["post", "post2", "request_post", "enable_post_connection_check", "enable_post_connection_check="]

>> Net::HTTP.methods.grep(/post/)
=> ["post_form"]

Which means that post_form is not an instance method of Net::HTTP but a class method.  However, there is an instace method Net::HTTP#post, which may be what you're looking for.

Regards,
Michael Guterl

Reply all
Reply to author
Forward
0 new messages