0
我想从一个Rails应用程序发送一个POST/GET到一个特定的地址。然而,当我运行应用程序,我得到了错误:“无连接可以作出,因为目标机器积极地拒绝它 - (2)连接。”下面是我的代码:Rails - 由于目标机器主动拒绝,无法建立连接。 - connect(2)
def show
@uri = URI('example.com/getuser?user=bob&[email protected]')
@profile = Net::HTTP.get(@uri)
puts @profile
end
你确定你想查询服务器启动并运行? – Strelok 2012-07-23 15:50:10
是的。尝试在interner浏览器中粘贴url并且它工作正常。 – user1480797 2012-07-23 15:51:53
试试这个:'@uri = URI('http://example.com/getuser?user=bob&[email protected]')' – 2012-07-23 15:52:40