Created
May 12, 2012 13:46
-
-
Save ashtom/2666601 to your computer and use it in GitHub Desktop.
Log ActiveResource request / response
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
class ActiveResource::Connection | |
def http | |
# Setup http object | |
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 | |
# Log to stderr | |
http.set_debug_output $stderr | |
# Return http object | |
return http | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment