Created
August 12, 2011 02:44
-
-
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
This file contains 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 '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