Net/http get value

I have two app in rails that communicate between net/http:
In the first app controller is something like so:

class WebservicesController < ApplicationController
  require 'net/http'
  require "uri"
   layout 'admin'
  def ws
        uri = URI("http://localhost:3001/api/ws")
        response = Net::HTTP.post_form(uri, {'campaign_id' => '1'})
        debugger
         @res = response
   respond_to do |format|
      format.html
    end
  end
end

In the second app controller is like that:

class ApiController < ApplicationController
  def ws
    begin
           debugger
            req =Smsq.find_by_campaign_id(params[:campaign_id])
           return req

    rescue Exception => exception
          return "NOK  : #{exception.message}"
    end
  end
end

But response return: #<Net::HTTPOK:0x000000090ab708>

But how can i get the result for this query

Smsq.find_by_campaign_id(params[:campaign_id]) in my first app??

I have result when i try to the console.

Thank you

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs