Sha256: c03af136e0f3e04e570adbfab91e9e4f373f2e08174a44bd329ae00ff2563c27

Contents?: true

Size: 711 Bytes

Versions: 17

Compression:

Stored size: 711 Bytes

Contents

module Weary
  class Response
    # Weary doesn't like Content-Type headers with extra bits on the end, like '; encoding=utf-8'.
    def content_type ; @content_type.split(';').first ; end
    
    def value ; self ; end
  end
 
  # Weary runs multi-threaded by default. The thread is spawned in perform!(). Let's not do that.
  class Request
    def perform!(&block)
      @on_complete = block if block_given?
      before_send.call(self) if before_send
      req = http.request(request)
      response = Response.new(req, self)
      if response.redirected? && follows?
        response.follow_redirect
      else
        on_complete.call(response) if on_complete
        response
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
em-net-http-0.3.10 lib/em-net-http/weary.rb
em-net-http-0.3.9 lib/em-net-http/weary.rb
em-net-http-0.3.8 lib/em-net-http/weary.rb
em-net-http-npn47-0.1.1 lib/em-net-http/weary.rb
em-net-http-npn47-0.1.0 lib/em-net-http/weary.rb
em-net-http-0.3.7 lib/em-net-http/weary.rb
em-net-http-0.3.6 lib/em-net-http/weary.rb
em-net-http-0.3.5 lib/em-net-http/weary.rb
em-net-http-0.3.2 lib/em-net-http/weary.rb
em-net-http-0.3.1 lib/em-net-http/weary.rb
em-net-http-0.3.0 lib/em-net-http/weary.rb
em-net-http-0.2.5 lib/em-net-http/weary.rb
em-net-http-0.2.4 lib/em-net-http/weary.rb
em-net-http-0.2.3 lib/em-net-http/weary.rb
em-net-http-0.2.0 lib/em-net-http/weary.rb
em-net-http-0.1.3 lib/em-net-http/weary.rb
em-net-http-0.1.2 lib/em-net-http/weary.rb