similar to: Sending post request with post_form

Displaying 20 results from an estimated 400 matches similar to: "Sending post request with post_form"

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
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 logger.info(''About to post at
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"
2010 May 17
2
"end of file" error for "net/https"
Hi, I have written following code:- It is working fine for 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 =
2006 Mar 11
1
feedburner api xml
I''m trying to query feedburner''s api (as according to their documentation). I''m using ''net/http'' as outlined here: @feed_stats = Net::HTTP.get(URI.parse("http://api.feedburner.com/awareness/1.0/GetFeedData?uri=" + @feed_uri)) The query returns this xml: <?xml version="1.0" encoding="UTF-8"?> <rsp
2010 Sep 01
4
NoMethodError: undefined method `force_encoding' for "Conten
Hi everyone! Im trying to install mechanizer from http://github.com/tenderlove/mechanize. I`ve clone the project into /tmp folder. When I do rake inside the folder /tmp/mechanizer it gives me this error: mac159180:mechanize renatosis$ rake (in /private/tmp/mechanize) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w -Ilib:bin:test:. -e ''require "rubygems";
2008 Jul 09
2
setting request.raw_post with rspec-rails
... is there a way to do this? We have some REST-ish POSTs we''d like to spec out. In the controller this gets accessed with request.raw_post.to_s, is there a way to set this with rspec? Thanks as always, Francis
2012 Feb 16
3
Mechanize::ResponseCodeError: 500
> Excuse me if my issue is a little bit application-specific. I need > Mechanize to submit bunch of data from our server to an online reservation > system. The url is https://secure.mdausa.org/donate/ > It works in my browser however using mechanize following error appears: > > /Library/Ruby/Gems/1.8/gems/mechanize-2.0.1/lib/mechanize/http/agent.rb:241:in > `fetch'':
2010 Jun 03
3
issue submitting a form
Hi. Recently I started rebuilding my old Mechanize script, which I used to automatically log in to a certain site and retrieve files from it. Old version worked great, however, when I did the update it started complaining. Here''s the log of the error: /Users/lukastolyarov/.gem/ruby/1.8/gems/mechanize-1.0.0/lib/mechanize/form/field.rb:30:in `<=>'': undefined method
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 May 04
2
How can I get posted params in correct order?
I''d like to have posted form field data in the same order they were in the form. Raw_post shows the data in correct order but params hash doesn''t. This happens every time (tried it with webrick). Any ideas how to get an array of objects in the correct order? -- Posted via http://www.ruby-forum.com/.
2007 Feb 26
3
POST data not coming through
I developed an application using Rails and the WeBrick, and now I''ve moved it to the production server using apache/fcgid. Now, however, post data is not being populated in the params hash. Even a simple form with one hidden field, which works fine as a GET request, does not work using POST. The problem isn''t with the form, as I''ve posted the data to a simple php
2006 Jun 26
6
paypal ipn from leetsoft
Has anyone had any luck with the paypal gem from leetsoft (Tobias Luetke)? I''m successfully sending off and making payments, but the ipn doesn''t send back to my site. I have the notify_url set in the form, have a action set for the ipn postbacks, but all I get from my sandbox after payment is a "view shops" page from paypal after payment is made. -- Posted via
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
2006 Jul 21
4
observe_field submit behavior
I am using observe_field on a number of multi-selects and checkbox form elements whose values would normally come in as arrays on a normal (non-Ajax) form post. I understand that by using the :with => ''name'' I will get name=value in the request.raw_post however if the field I am submitting has mutliple values and the name is of the form ''name[]'', I get
2006 Jan 18
5
NOOB Ajax question: handling form input
Hi, I was trying to modify how a standard edit form works so I could use Ajax to truncate a zip code field which became too long as the user is entering the value. The form was generated by the generate scaffold script. The form is filled with default data taken from the current record. I coded the following changes to a field in the _form.rhtml file: <%= text_field
2006 Dec 29
4
Remote API passing in parameter named 'action', routing loses it
I''m working with a remote API that calls a URL in my app, passing in a parameter named action. So the request would look like: http://localhost/my_controller?action=foo Routing correctly interprets the controller action as index. However, it sets params[:action] to index as well. I know that''s how it''s supposed to work...but it means I lose the action parameter
2006 Jun 07
5
little Live search problem
Works fine but when you use backspace or delete on the search word and it hits 0 characters it displays ALL the Test names in the database! def live_search @phrase = request.raw_post || request.query_string a1 = "%" a2 = "%" @searchphrase = a1 + @phrase + a2 @results = Test.find(:all, :conditions => [ "test_name LIKE ?", @searchphrase])
2006 May 23
1
Help with observe_field
Folks, When I use observe_field, I get a javascript error "Form is not defined". Any thoughts? __View: search.rhtml__ <label for="search">Search:</label> <%= text_field_tag :search %> <%= observe_field(:search, :frequency => 0.25, :update => :search_hits, :url => { :action =>
2006 Feb 11
1
How to POST raw data?
Hi, I know that ActionController::AbstractRequest provides a raw_post method that reads the data that has been posted to the HTTP server as raw data. I am trying to create a rails application that POSTs raw XML data to a web page that reads raw data. I would like to know how to POST raw data to an HTTP server using Ruby on Rails. Can you help me with this? Thanks, Yash -- Posted via