Skip to content

Instantly share code, notes, and snippets.

@corntrace
Created December 5, 2009 00:48
Show Gist options
  • Select an option

  • Save corntrace/249493 to your computer and use it in GitHub Desktop.

Select an option

Save corntrace/249493 to your computer and use it in GitHub Desktop.
Post a form using Net::HTTP
# 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