Created
January 5, 2012 08:15
-
-
Save shelling/1564225 to your computer and use it in GitHub Desktop.
redirect browser to post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'sinatra/base' | |
| class App < Sinatra::Base | |
| get "/" do | |
| redirect "/hello.html" | |
| end | |
| post "/" do | |
| params.inspect | |
| end | |
| end | |
| run App |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <script> | |
| window.onload = function() { document.forms[0].submit() }; | |
| </script> | |
| </head> | |
| <body> | |
| <form action="/" method="post"> | |
| <input type="hidden" name="hello" value="world"> | |
| <input type="submit" value="submit"> | |
| </form> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment