Method: Mechanize::HTTP::Agent#post_connect

Defined in:
lib/mechanize/http/agent.rb

#post_connect(uri, response, body_io) ⇒ Object

Invokes hooks added to post_connect_hooks after a response is returned and the response body is handled.

Yields the context, the uri for the request, the response and the response body.



414
415
416
417
418
419
420
421
422
# File 'lib/mechanize/http/agent.rb', line 414

def post_connect uri, response, body_io # :yields: agent, uri, response, body
  @post_connect_hooks.each do |hook|
    begin
      hook.call self, uri, response, body_io.read
    ensure
      body_io.rewind
    end
  end
end