views:

13

answers:

1

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?

A: 

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?

Pekka