Skip to content

Instantly share code, notes, and snippets.

@ryanlecompte
Created March 22, 2012 20:34
Show Gist options
  • Save ryanlecompte/2163807 to your computer and use it in GitHub Desktop.
Save ryanlecompte/2163807 to your computer and use it in GitHub Desktop.
Monkey-patching the aws-sdk gem to dump its raw requests
require 'aws-sdk'
module RequestDumper
def new(*args, &block)
super.extend(DumpRequests)
end
module DumpRequests
def request(*args, &block)
puts "SENDING: #{args.first.body}"
super
end
end
end
Net::HTTP::ConnectionPool::Connection.extend(RequestDumper)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment