Created
March 18, 2009 19:38
-
-
Save julesfern/81339 to your computer and use it in GitHub Desktop.
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
| >> url = URI.parse("http://spreedly.com/api/v4/tails-test/subscribers/9/stop_auto_renew.xml") | |
| => #<URI::HTTP:0x10353c6 URL:http://spreedly.com/api/v4/tails-test/subscribers/9/stop_auto_renew.xml> | |
| >> req = Net::HTTP::Post.new(url.path) | |
| => #<Net::HTTP::Post POST> | |
| >> req.basic_auth 'sdfsdf', 'sdfsdf' | |
| => ["Basic MWJjMjlmNDc3NGRhZjYyZTJkN2E0MWQ4NzU4M2FiYjc4MmM4M2Q3MTptb2NoaW1vY2hp"] | |
| >> res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) } | |
| => #<Net::HTTPFound 302 Found readbody=true> | |
| >> res.body | |
| => "<html><body>You are being <a href=\"https://spreedly.com/api/v4/tails-test/subscribers/9/stop_auto_renew.xml\">redirected</a>.</body></html>" | |
| >> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment