我使用httparty进行了发布。
E.g。
options={
:foo => '123'
:bar => 'second',
:baz => 'last thing'
}
HTTParty.post("localhost/tests" , options)
如何在远程app控制器中检索选项参数: E.g。
#post /tests
def create
@k=options[:name] -------> Here is my question, How can I access options[:name]?
我的意思是我应该将选项作为create方法的参数传递吗?类似的东西:
def create(options)
@k=options[:name]
答案 0 :(得分:0)
好吧,它最终对我有用。我应该分别检索每个字段而不是整体。很高兴!所以现在我有2个rails应用程序。只需单独包装字段并单独提取它我就可以发布和检索。