Created
December 5, 2009 00:48
-
-
Save corntrace/249493 to your computer and use it in GitHub Desktop.
Post a form using Net::HTTP
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
| # Post the email to the Rails app's restful service | |
| res = Net::HTTP.post_form(URI.parse(service_url), {'params_name'=> params_value}) | |
| case res | |
| when Net::HTTPSuccess, Net::HTTPRedirection | |
| # OK | |
| else | |
| res.error! | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment