Skip to content

Instantly share code, notes, and snippets.

@adamvduke
Created August 12, 2011 02:44
Show Gist options
  • Save adamvduke/1141332 to your computer and use it in GitHub Desktop.
Save adamvduke/1141332 to your computer and use it in GitHub Desktop.
curl is great unless you have a bunch of form params to post
require 'restclient'
#flip verbose to get more or less output
verbose = true
if verbose
require 'net-http-spy'
Net::HTTP.http_logger_options = {:verbose => true}
end
# params get form-encoded
post_params = {
:ohai => "lol wut?!*'();:@&=+$,/?%#[]",
:ohnoz => "really?"
}
post = RestClient.post "http://not-doing-much.heroku.com/", post_params
puts post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment