Method: VCR::Configuration#after_http_request

Defined in:
lib/vcr/configuration.rb

#after_http_request(*filters) {|request, response| ... } ⇒ Object

Adds a callback that will be called with each HTTP request after it is complete.

Examples:

VCR.configure do |c|
  c.after_http_request(:ignored?) do |request, response|
    puts "Request: #{request.method} #{request.uri}"
    puts "Response: #{response.status.code}"
  end
end

Parameters:

  • filters (optional splat of #to_proc)

    one or more filters to apply. The objects provided will be converted to procs using ‘#to_proc`. If provided, the callback will only be invoked if these procs all return `true`.

Yields:

  • the callback

Yield Parameters:

See Also:



366
367
368
# File 'lib/vcr/configuration.rb', line 366

def after_http_request(*filters)
  super(*filters.map { |f| request_filter_from(f) })
end