goo.gl 缩短 api:通过 GET 请求缩短
是否可以通过 GET 请求使用 Goo.gl 缩短 api 来缩短 URL?他们唯一的指令是 POST,如果他们没有办法通过 GET 来做到这一点,那就没有多大意义了。
Is it possible to shorten a URL using the Goo.gl shortening api with a GET request? Their only instructions are for POST and it doesn't make much sense that they wouldn't have a way to do this via GET.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上他们不太可能支持 GET 这样做。良好的实践要求 GET 请求不会在 Web 应用程序中造成副作用(永久数据更改)。这可以防止与网络蜘蛛相关的问题,这些问题仅通过尝试抓取网站而造成严重破坏(想象一下与 GET 配合使用的“删除”按钮,导致蜘蛛无意中删除内容)。
此外,强制第三方执行 GET 请求要容易得多(即,将 URL 嵌入论坛上的图像标签中),这通常是一个安全问题。就 goo.gl 而言,它将允许对服务进行微不足道且难以阻止的 DoS 类型攻击。
It's actually unlikely that they support GET to do that. Good practice requires that GET requests not cause side effects (permanent data changes) in web applications. This prevents problems related to web spiders causing havoc simply by trying to crawl a site (imagine a "delete" button that worked with a GET, causing a spider to inadvertently remove content).
Additionally, GET requests are a lot easier to force a third party to do (i.e. embed the url in an image tag on a forum) which often is a security problem. In the case of goo.gl, it would allow trivial and hard to block DoS type attacks on the service.