Skip to content

Instantly share code, notes, and snippets.

Created June 12, 2012 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/2920469 to your computer and use it in GitHub Desktop.
Save anonymous/2920469 to your computer and use it in GitHub Desktop.
~/public_html/form.html=>
<form method="post" action="process.rb">
Username:<input type="text" id="id_input_username" name="name_input_username" /><br/>
<input type="submit" name="Submit"/>
</form>
~/public_html/process.rb=>
#!/home/user1/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
require "uri"
require "net/http"
#params = {'name_input_username' => 'hello-world','name_submit' => 'Submit'}
x = Net::HTTP.post_form(URI.parse('http://localhost:8000/form.html'))
puts x.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment