使用 REST API Rails [英] Consuming REST API Rails

查看:29
本文介绍了使用 REST API Rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看过这个问题,但它很老了,我觉得现在有其他替代品可以替代 AR.

I've looked at this question but it's quite old and I feel there's now other alternatives to ARes.

鉴于很多人似乎认为 ActiveResource 有点过时和重量级,我查看了 Api SmithRoar,当然还有 ARs.

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 或 Faraday 这样的低级库?他们将为您介绍许多丑陋的东西(ssl、解析/序列化 json 和 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆