2013-03-27 27 views
1

我試圖與Vacuum gem鬼混得到XML,但我有一個例子一些問題。當我運行的代碼在FrontPage中描述:如何使用Rails的真空寶石和響應

req = Vacuum.new 

req.configure key: 'foo', 
       secret: 'secret', 
       tag: 'biz-val' 

params = { 'Operation' => 'ItemSearch', 
      'SearchIndex' => 'Books', 
      'Keywords' => 'Architecture' } 

res = req.get query: params # XPath is your friend. 

我有問題從響應中獲取XML。我可以看到對象類型爲Excon::Response,實際上包含數據,但是如何檢索它包含的XML?

我試圖與這兩個res.to_xml和res.xml,甚至把它載入引入nokogiri,但沒有成功。

回答

0

我發現了。 XML被保存在響應中的對象Body中。