Class: Faraday::Adapter::FuryHttp
- Inherits:
-
NetHttp
- Object
- NetHttp
- Faraday::Adapter::FuryHttp
- Defined in:
- lib/faraday/adapter/fury_http.rb
Instance Method Summary collapse
Instance Method Details
#request_with_wrapped_block(http, env, &block) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/faraday/adapter/fury_http.rb', line 8 def request_with_wrapped_block(http, env, &block) is_text = env.request_headers['Accept'] =~ /text\z/ return super if !block.nil? || !is_text # Stream chunks directly to STDOUT resp = super(http, env) do |chunk| $stdout.print(chunk) $stdout.flush end # Client sees nil body resp.body = nil resp end |