NET/HTTP GET VALUE

16 views
Skip to first unread message

Simon Eric

unread,
Mar 7, 2015, 6:57:35 AM3/7/15
to rubyonra...@googlegroups.com
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

--
Posted via http://www.ruby-forum.com/.
Reply all
Reply to author
Forward
0 new messages