search for: post_form

Displaying 20 results from an estimated 22 matches for "post_form".

2006 Mar 19
1
Sending post request with post_form
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 '...
2007 Jun 12
1
alias_method_chain and Class methods (a Ruby question)
Hello list, I am trying to override the post_form method of Net::HTTP so that it does something before actually doing the post. I tried the following in environments/development.rb module Net class HTTP alias_method_chain :post_form, :intercept def post_form_with_intercept(url, params) # Do something before post...
2009 Jun 05
1
Slow/unpredictive response of post_form from rails lib
Hi friends, I''m facing a very strange problem... I consume a webservice from within my rails app. I''ve written a thin wrapper around the webservice using Net::HTTP.post_form However, when calling the API from within my controllers, the API calls randomly fail, complaining about timeout. But - when I wrote a simple iterative test (500 iterations), calling the same webservice using same thin wrapper (via rake) - to my surprise, none of the calls failed. I repeated the...
2006 Nov 04
0
Net::HTTP.post_form got 200 but no INSERT INTO. How come? How to fix this?
Hello, I''m playing around with net/http and open-uri Ruby Libraries.. I''m trying to post to my own rails simple new action method. Here''s my irb : irb(main):013:0> res = Net::HTTP.post_form(URI.parse("http://localhost:3002/blog2/new"), {"commit" => "Save", "signature_id" => "", "signature_content" => "hey rails, it''s me ruby, your lover, why can you not insert me"}) => #<Net::HTTPOK 200 OK re...
2010 May 17
2
"end of file" error for "net/https"
...r http protocol. But whenever I am doing for https I getting an error "end of file reached". Can anyone tell me what is wrong with the code? def email_to_friend require ''net/http'' require "net/https" require ''uri'' #res = Net::HTTP.post_form(URI.parse(''http://www.test.com/''),{''q''=>''ruby''}) res = Net::HTTP.post_form(URI.parse(''https://product-search.api.cj.com/v2/product-search''), {''q''=>''ruby''}) puts res.body end...
2007 Jul 06
0
Removing One Element From a Serialized Form
Hi all, I''m trying to serialize a form with the exception of one specific element. Serializing the form in a hash (without pulling out specific elements) works: <li> <%= link_to_remote ''(Save)'', {:url => post_path(@post), :with => "$ (''post_form'').serialize(true)" }, :method => :put %> </li> The generated code is: <li><a href="#" method="put" onclick="new Ajax.Request(''/posts/1'', {asynchronous:true, evalScripts:true, parameters:$ (''post_form'')...
2010 Sep 01
4
NoMethodError: undefined method `force_encoding' for "Conten
....rb"; require "test/test_meta.rb"; require "test/test_multi_select.rb"; require "test/test_no_attributes.rb"; require "test/test_option.rb"; require "test/test_page.rb"; require "test/test_pluggable_parser.rb"; require "test/test_post_form.rb"; require "test/test_pretty_print.rb"; require "test/test_radiobutton.rb"; require "test/test_redirect_limit_reached.rb"; require "test/test_redirect_verb_handling.rb"; require "test/test_referer.rb"; require "test/test_relative_links.r...
2012 Feb 16
3
Mechanize::ResponseCodeError: 500
...echanize following error appears: > > /Library/Ruby/Gems/1.8/gems/mechanize-2.0.1/lib/mechanize/http/agent.rb:241:in > `fetch'': 500 => Net::HTTPInternalServerError (Mechanize::ResponseCodeError) > from /Library/Ruby/Gems/1.8/gems/mechanize-2.0.1/lib/mechanize.rb:628:in > `post_form'' > from /Library/Ruby/Gems/1.8/gems/mechanize-2.0.1/lib/mechanize.rb:520:in > `submit'' > from > /Library/Ruby/Gems/1.8/gems/mechanize-2.0.1/lib/mechanize/form.rb:167:in > `submit'' > > Can anybody help me please? > > Thanx, > > Jo?o Henriq...
2010 Jun 03
3
issue submitting a form
...m/ruby/1.8/gems/mechanize-1.0.0/lib/mechanize/form.rb:171:in `build_query'' from /Users/lukastolyarov/.gem/ruby/1.8/gems/mechanize-1.0.0/lib/mechanize/form.rb:221:in `request_data'' from /Users/lukastolyarov/.gem/ruby/1.8/gems/mechanize-1.0.0/lib/mechanize.rb:452:in `post_form'' from /Users/lukastolyarov/.gem/ruby/1.8/gems/mechanize-1.0.0/lib/mechanize.rb:370:in `submit'' from downloader.rb:16:in `downloader'' from downloader.rb:38 Basically, what I''m doing is this: require ''rubygems'' require &...
2008 Jan 14
3
Reading HTTP Request parameters
Hello I''ve a client which send this request to a mongrel HTTPHandler : res=Net::HTTP.post_form(URI.parse(''http://localhost:3000/test''),{"a"=>1,"b"=>2}) But in the handler I can''t read the parameters one by one, I can read the entire String only : class Serveur class MyHandler < Mongrel::HttpHandler def process(req, resp)...
2006 Nov 30
0
Query string based on the selection in HTTP POST
...selected. For example it could be www.test.com/search?id=1 or www.test.com/search?id=1&zip=60008. How could I achieve this using http::POST? I tried the following, which didn''t work url = "{''id'' => 1, ''zip'' => 60008}" res = Net::HTTP.post_form(URI.parse''http://www.test.com/search.php''),url) res = @responsestream = res.body I guess url is a string and in the post_form it''s suppose to be hash. Not sure how to do that. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-----...
2010 Oct 31
1
Rails application Webservices
hi all, I have a rails application at http://electric-sky-98.heroku.com/products require ''net/http'' require ''uri'' res = Net::HTTP.get_response(URI.parse(''http://electric- sky-98.heroku.com/products.xml'')) puts res.body the above code gave me the xml file below: <?xml version="1.0"
2006 Apr 29
0
Trouble with firefox and AJAX
...end else # Create a new Post or load one--to edit if params[:id] @post = Post.find(params[:id]) else @post = Post.new :topic_id=>params[:topic] end end render :partial => "post_form", :object => @post end end ==== viewtopic.rhtml ==== <!-- there''s a layout used that imports prototype --> <div id=''posts''> <%= render :partial => "post", :collection => @posts %> </div> <br /> <!-- inser...
2006 Oct 17
9
Ferret Smoke Test
Hey folks, I''ve added a smoke test script to Ferret. It is named smoke_test.rb and it can be found in the base of the working directory. So what are you supposed to do with it you ask? Well, if you want to help keep Ferret working on your system of choice then set up a cron task to run this script regularly. What the script does is call `svn update` to get the latest working revision.
2006 Jul 07
4
Saving Objects without Saving Objects
I have a problem that I think is probably fairly common but I haven''t seem to be able to come up with the magic combination of search terms to find a solution (or it really isn''t that common). Here''s the deal... Scenario: A system allows a user to enter in articles via a web-form. The system provides a preview function; not a live preview, but a preview on another
2006 Jul 03
1
help getting plugin to work
...s/yui/lib/yui_helper.rb module ActionView module Helpers module YuiHelper def yui_form_remote_tag(options = {}) options[:html] ||= {} options[:html][:action] = options[:html][:action] || url_for(options[:url]) options[:html][:onsubmit] = "Yui.post_form(''#{options[:html][:action]}'',this);return false;" options[:html][:method] = options[:html][:method] || ''post'' tag(''form'', options[:html], true) end end end end When I use <%= yui_form_remote_tag(:url=>{:...
2009 Sep 25
0
WWW::Mechanize and Rails console not playing well
...from /usr/lib/ruby/1.8/www/mechanize/util.rb:6:in `map'' from /usr/lib/ruby/1.8/www/mechanize/util.rb:6:in `build_query_string'' from /usr/lib/ruby/1.8/www/mechanize/form.rb:199:in `request_data'' from /usr/lib/ruby/1.8/www/mechanize.rb:387:in `post_form'' from /usr/lib/ruby/1.8/www/mechanize.rb:331:in `submit'' from (irb):23 >> Here''s the code: #!/usr/local/bin/ruby require ''rubygems'' require ''mechanize'' require ''logger'' require ''uri'...
2007 Sep 14
1
Unable to scrap gmail.com - EOFError: End of file reached
...lib/ruby/1.8/net/http.rb:2006:in `read_new'' from /usr/lib/ruby/1.8/net/http.rb:1047:in `request'' from /var/lib/gems/1.8/gems/mechanize-0.6.10/lib/mechanize.rb:514:in `fetch_page'' from /var/lib/gems/1.8/gems/mechanize-0.6.10/lib/mechanize.rb:428:in `post_form'' from /var/lib/gems/1.8/gems/mechanize-0.6.10/lib/mechanize.rb:247:in `submit'' from (irb):10 from :0 irb(main):011:0> When I do a submit on the form, I get this huge backtrace. It would be great if anyone can help me out with this problem - some pointe...
2007 Sep 11
3
Production mode bug with ruby/amazon
Hi all, I''ve got an issue that only ever appears in production mode. I''ve got my app hooked up to amazon''s web service (ECS, using ruby/amazon from http://www.caliban.org/ruby/ruby-amazon.shtml). In the dev environment, everything''s peachy. But in production mode, after I''ve left the app up for a couple of hours (sometimes, minutes), I get an
2007 May 23
4
Error when posting form
...rb:1522:in `exec'' from /usr/local/lib/ruby/1.8/net/http.rb:1045:in `request'' from /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:443:in `fetch_page'' from /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:357:in `post_form'' from /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.8/lib/mechanize.rb:234:in `submit'' from (irb):28 from :0 I''d be happy to provide any other information needed to help debug the problem. Thanks, Michael Guterl -------------- next part -------...