有任何代理可以替代 URL Shortener 来显示表单 POST 页面结果吗?

发布于 2024-09-18 20:08:34 字数 891 浏览 1 评论 0原文

我希望分享某个页面的链接,但该页面的内容只能通过提交表单获得。

这是一个例子: 我想查看加利福尼亚州为美国造币厂出售金条的零售商名单。但是我必须提交表格才能获得结果: http://www.usmint.gov/mint_programs/american_eagles/index.html cfm?action=lookup

我想要看到的是一个中间站点,它基本上充当执行我的表单 POST 的代理。因此,我可以从该站点共享我的链接,任何点击该链接的人都会看到表单 POST 的输出(该输出是使用我之前告诉后代理站点使用的目标 URL 和表单数据制作的)。

因此,这与 URL 缩短服务有类似的需求,我有一个可以发布在 Twitter、Digg 甚至电子邮件中的 URL(例如 post-agent.com/ca-bullion )。然而,与 URL 缩短服务不同的是,由于明显的浏览器安全限制,结果页面仍然会显示来自中介的 URL(例如 post-agent.com )。

因此,使用上面的示例,post-agent.com/ca-bullion 请求只需响应以下结果:

$ lwp-request -m POST www.usmint.gov/mint_programs/american_eagles/index.cfm?action=lookup
state=CA&submit=GO
[Ctrl-D]

是的,输出会很丑陋(除非重写了图像 URL 的链接),但至少页面内容/只需单击一下即可获取数据。

有这样的事情存在吗?

如果不是,应该这样做吗?

I wish to share a link to a page however the contents for that page are only available from submitting a form.

Here's an example:
I want to see the list of retailers in California that sell gold bullion for the U.S. Mint. However I must submit the form to get the results:
http://www.usmint.gov/mint_programs/american_eagles/index.cfm?action=lookup

What I'd like is to see is a intermediary site that basically works as an agent that performs my form POST. Thus I can share my link from this site and anyone clicking on that link sees the output of the form POST (which was made using the target URL and form data that I previously told the post-agent site to use).

So, this serves a similar need as the URL shortening services, where I have an URL (e.g., post-agent.com/ca-bullion ) that can be posted on Twitter, or Digg or in an e-mail even. However unlike an URL shortening service, the resultant page would still hvae to show the URL from the intermediary (e.g., post-agent.com ) due to obvious browser security restrictions.

Thus using my example above, the post-agent.com/ca-bullion request simply responds with results from a:

$ lwp-request -m POST www.usmint.gov/mint_programs/american_eagles/index.cfm?action=lookup
state=CA&submit=GO
[Ctrl-D]

Yes, the output would be ugly (unless the links to image URLs were re-written) but at least the page content / data would be a single click away.

Does anything like this exist?

If not, should it?

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

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

发布评论

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

评论(1

请你别敷衍 2024-09-25 20:08:37

非常有趣的想法。

按照您描述的方式,该服务必须充当一种代理。

这样做会出现问题,例如,如果 POST 请求的结果设置了 cookie。此外,请求的来源将是“代理”服务器,而不是用户的 IP。该服务还必须通过潜在的大量流量。

更可行的实现可能是提供带有表单的页面。该表单将具有 method="POST" 和来自 URL 预设的变量。该表单可以通过 Javascript 自动提交(使其几乎对用户不可见)或手动提交。

并非所有服务都适用于该方法,因为您必须期望某些站点在表单和其他检查中使用一次性令牌以防止 跨站请求伪造。但对于像您展示的这样的简单服务,这可能会很有效。

然而,我发现要让最终用户轻松使用它存在困难。他们如何在不使用浏览器工具检查发布的网站的情况下将 POST 请求发送到您的表单中?

Very interesting idea.

The way you describe it, the service would have to act as a kind of Proxy.

There are problems with this, for example if the result of the POST request sets cookies. Also, the origin of the request will be the "proxy" server, not the user's IP. The service would also have to pass through potentially huge amounts of traffic.

A more viable implementation of this might be providing a page with a form. The form would have method="POST" and the variables from the URL pre-set. The form would get submitted either automatically through Javascript (making it almost invisible to the user) or manually.

Not every service would work with the method, because you'd have to expect some sites to use one-time tokens in forms and other checks to prevent against cross-site request forgery. But for simple services like the one you show, this might work well.

I see difficulties in making this easily usable for end users, however. How would they get their POST request into your form without inspecting the posted web site using a browser tool?

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