最适合 URL 缩短服务的 API

发布于 2024-08-12 04:05:00 字数 192 浏览 2 评论 0 原文

我刚刚完成了一项用于缩短 URL 的在线服务(在带有 Zend Framework 的 php5 中);您可以输入一个 URL,然后您会得到一个短 URL(例如tinyurl 等网站)。

我正在考虑为开发人员提供 API - 目前您可以使用 SOAP 向服务发送 URL,但我不确定这是否是一个好的解决方案。此类服务的最佳实践是什么?休息?肥皂?两个都?

I've just finished an online service for shortening URLs (in php5 with Zend Framework); you can enter an URL and you get an short URL (like tinyurl and such sites).

I'm thinking about the API for developers - at the moment you can send URLs with SOAP to the service, but I am not sure if this is a good solution. What is the best practice for such a service? REST? SOAP? Both?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

掩饰不了的爱 2024-08-19 04:05:00

我会限制自己休息,因为整个“API”只是两次调用(返回长网址或短网址,反之亦然)。

i'd limit myself to rest, because the whole "API" is just two calls (return the long url for short and vice versa).

澜川若宁 2024-08-19 04:05:00

绝对是 REST - SOAP 的开销是不必要的,除非您正在构建一个特别安全的企业 URL 缩短服务(我认为这可能是一个矛盾)。 bit.ly API 相当不错,值得一试。

Definitely REST - the overhead for SOAP is unnecessary unless you're building a particularly secure enterprise URL shortening service (which I think is probably an oxymoron). The bit.ly API is pretty good and worth checking out.

最美不过初阳 2024-08-19 04:05:00

在这种情况下,我会说一直采用 REST,SOAP 对此来说太过分了,除了增加网络负载之外什么也得不到。该 API 足够简单,文本描述就足够了,尽管您可能想查看 WADL

In this situation I'd say REST all the way, SOAP is overkill for this and gets you nothing other than an increase in network load. The api is simple enough for a textual description to suffice although you might want to look at WADL

并安 2024-08-19 04:05:00

还投票支持 REST,因为 SOAP 对于这个小型 API 来说是一个巨大的野兽和过大的杀伤力。另外,所有流行的 url 缩短服务都使用 REST。您甚至应该考虑紧邻更受欢迎的服务之一,因为这可能有助于开发人员更轻松地添加您的服务;)

Also voting for REST as SOAP is such a big beast and overkill for this small API. Plus all popular url shortening services use REST. You even should consider being quite next to one of the more popular services as this might help developers to more easily add you service ;)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文