# Sending post request with post\_form

**URL:** <https://www.ruby-forum.com/t/sending-post-request-with-post-form/83934>\
**Category:** Rails\
**Created:** [March 19, 2006, 1:46pm UTC](https://www.ruby-forum.com/t/sending-post-request-with-post-form/83934 "2006-03-19T13:46:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@alex](https://www.ruby-forum.com/u/alex)\
**Post date:** [March 19, 2006, 1:46pm UTC](https://www.ruby-forum.com/t/sending-post-request-with-post-form/83934/1 "2006-03-19T13:46:43Z")

</div>

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=](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?

---

<div class="post-metadata">

**Author:** ![alex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@alex](https://www.ruby-forum.com/u/alex)\
**Post date:** [March 19, 2006, 9:23pm UTC](https://www.ruby-forum.com/t/sending-post-request-with-post-form/83934/2 "2006-03-19T21:23:27Z")

</div>

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
