Created
May 25, 2010 15:55
-
-
Save perplexes/413306 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
| # Override http debugging, pipe to STDERR. | |
| # Output: | |
| # <- "POST /watched.xml HTTP/1.1\r\nAccept: */*\r\nConnection: close\r\nContent-Type: application/xml\r\nAuthorization: Basic MzkyZih7219fIUH\r\nContent-Length: 82\r\nHost: xxxxxxxxxxx.com\r\n\r\n" | |
| # <- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n" | |
| # -> "HTTP/1.1 422 Unprocessable Entity\r\n" | |
| module ActiveResource | |
| class Connection | |
| def http | |
| http = Net::HTTP.new(@site.host, @site.port) | |
| http.use_ssl = @site.is_a?(URI::HTTPS) | |
| http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl | |
| #http.read_timeout = @timeout if @timeout # If timeout is not set, the default Net::HTTP timeout (60s) is used. | |
| http.set_debug_output $stderr | |
| http | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment