Forum: Ruby on Rails Sending post request with post_form

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Alex (Guest)
on 2006-03-19 14:46
Basically I have a controller with this:

@lang = params['lang'] || 'en'
@errors = request.raw_post
@feed_stats =
Net::HTTP.post_form(URI.parse("http://www.google.com/tbproxy/spell?lang="
+ @lang), @errors)
render :text => @feed_stats

However whenever I run this I get an error message:
undefined method `post_form' for Net::HTTP:Class

I've included
require 'net/http'
require 'uri'
in my enviroment.rb

can anyone help?
Ezra Z. (Guest)
on 2006-03-19 22:23
(Received via mailing list)
On Mar 19, 2006, at 4:46 AM, Alex wrote:

> However whenever I run this I get an error message:
> undefined method `post_form' for Net::HTTP:Class
>
> I've included
> require 'net/http'
> require 'uri'
> in my enviroment.rb
>
> can anyone help?
>



post_form is in ruby 1.8.4 and not in 1.8.2 So to get that method you
need to upgrade your ruby install. This hjas come up a few times
because the docs got cross pollenated to look like post_form is in
1.8.2 but it is not.

Cheers-
-Ezra
This topic is locked and can not be replied to.