Forum: Ruby on Rails using ruby to submit an http form - either im confused ...

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6e23e6d164e154160639848e0c08d575?d=identicon&s=25 Ryan Smith (Guest)
on 2007-03-29 01:06
Hi All:

I have a rails application (we'll call it 'FrontApp')that is using REST
routes. I have tested this with curl and its behaves as expected.

I also have a second independent rails application on the same server.
Also using REST routes. (we'll call this app 'BackApp').

I want to beable to call and submit a form in BackApp from FrontApp and
I think im going about it the wrong way. Should I be using web service
apis on BackApp and simply invoking the service calls from FrontApp or
can i (and it is good design) to try and post the form in BackApp from

Below is a snippet of a test script ive been using to attempt to post
the above mentioned form in BackApp using ruby. All i get back is the
details of the form but the event (an email sent) is not occurring as if
i were submitting the form in the BackApp application.'', 80).start do |http|

test_email_req ='/notification/email_request')
test_email_req.add_field 'Accept', 'application/xml'

response = http.request(test_email_req)

  case response
  when Net::HTTPSuccess
    puts "Code: #{response.code}"
    puts "Message: #{response.message}"
    puts "Body:\n #{response.body}"
    # Throw exception

any help would be appreciated
This topic is locked and can not be replied to.