消费REST API的Rails [英] Consuming REST API Rails
问题描述
我看了这个的问题,但它很老了,感觉现在有其他办法,以战神。
I've looked at this question but it's quite old and I feel there's now other alternatives to ARes.
Given that many people seem to think that ActiveResource is kind of outdated and heavyweight, I've looked at Api Smith, Her, Roar and of course ARes.
哪些宝石之一将是最可靠,面向未来的选择?
Which one of these gems would be the most reliable, and future proof alternative?
推荐答案
为什么不使用类似HTTParty或法拉第底层库的?它们将涵盖了很多丑陋的东西给你(SSL,解析/序列化jsons和XML的,日志,添加标题......),你会保持URL的完全控制和数据管理。
Why not using lower level libraries like HTTParty or Faraday ? They will cover a lot of the ugly stuff for you (ssl, parsing/serializing jsons and XMLs, logging, adding headers...) and you'll keep complete control of the URLs and the management of data.
这篇关于消费REST API的Rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!