Skip to content

Instantly share code, notes, and snippets.

View trevorrowe's full-sized avatar

Trevor Rowe trevorrowe

  • Amazon.com
  • Seattle, WA
View GitHub Profile
@trevorrowe
trevorrowe / debug handler example
Created March 22, 2012 21:34
Wrapping the aws-sdk http handler to view raw http requests and responses
# build a dummy http handler that extends the default handler
# that outputs the request body before making the request (via super)
# then check the response body
# req is a AWS::Core::Http::Request object
# resp is a AWS::Core::Http::Response object
default_handler = AWS.config.http_handler
debug_handler = AWS::Core::Http::Handler.new(default_handler) do |req,resp|
puts "REQUEST BODY: #{req.body}"
super(req,resp)