I have tried posting to test method and it doesn't do anything. The
browser stays on waiting for response...and after a couple of minutes
I get this: Timeout::Error in BuildsController#create execution
expired def create require 'net/http' require 'uri' @build = Build.new
(params[:build]) if @build.save res = Net::HTTP.post_form(URI.parse
('http://localhost:3000/apps/1/build'), {'q'=>'ruby', 'max'=>'50'})
end end def test puts params[:q] puts params[:max] end
sin la parte del delicioso
On Mar 9, 7:12 pm, bill walton <[email protected]> wrote:
> On Mon, 2009-03-09 at 16:42 -0700, bbtosurf wrote:
> > Can anyone give me any ideas on how to do this multipart
> > post in my controller?
>
> See the documentation on Ruby's Net::HTTP
> libraryhttp://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html
>
> In your controller you'll have something like...
>
> Class MyController < ActionController
> require 'net/http'
>
> def make_contact
> my_connection = Net::HTTP.new('www.target.com', 80)
> reponse = my_connection.post(path_within_url, data)
> #do something with response if you want
> end
>
> end
>
> IIRC you'll need to set a Content-Type prior to the post. Can't remember
> the setting syntax for the off the top of my head.
>
> HTH,
> Bill
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---