Spying on Ruby's Net::HTTP by jgn on Thursday, August 4, 2011 in Ruby and Code

I've heard two people complain that they can't see OAuth HTTP behavior and get unexpected 401s. If you want to see what's going on at the transport level, here's a monkeypatch (depends on ActiveSupport for the alias_method_chain) just for you:

[code language='ruby'] class Net::HTTP

def initialize_with_debug(*args, &block) initialize_without_debug(*args, &block) set_debug_output $stderr end

alias_method_chain :initialize, :debug end

comments powered by Disqus