Used for simple response middleware.
# File lib/faraday/response.rb, line 7 def call(env) @app.call(env).on_complete do |environment| on_complete(environment) end end
Override this to modify the environment after the response has finished. Calls the `parse` method if defined
# File lib/faraday/response.rb, line 15 def on_complete(env) env.body = parse(env.body) if respond_to?(:parse) && env.parse_body? end