Class: Azure::Core::Http::DebugFilter

Inherits:
HttpFilter
  • Object
show all
Defined in:
lib/azure/core/http/debug_filter.rb

Overview

A HttpFilter implementation that displays information about the request and response for debugging

Instance Method Summary collapse

Methods inherited from HttpFilter

#initialize

Constructor Details

This class inherits a constructor from Azure::Core::Http::HttpFilter

Instance Method Details

#call(req, _next) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/azure/core/http/debug_filter.rb', line 22

def call(req, _next)
  puts "--REQUEST-BEGIN---------------------------"
  puts "method:", req.method, "uri:", req.uri, "headers:", req.headers, "body:", req.body
  puts "--REQUEST-END---------------------------"

  r = _next.call
  puts "--RESPONSE-BEGIN---------------------------"
  puts "status_code:", r.status_code, "headers:", r.headers, "body:", r.body
  puts "--RESPONSE-END---------------------------"
  r
end