Sha256: 53463ef2711a7b037969e2a0a64de2f4bd8c8cfe813592d2d5bcb52b968d5834

Contents?: true

Size: 450 Bytes

Versions: 2

Compression:

Stored size: 450 Bytes

Contents

require 'em-synchrony/em-http'

module Rhinestone
  class HttpClient
    takes :hostname, :header_filter

    def get(path)
      response = EM::HttpRequest.new("http://#{hostname}#{path}").get(:redirects => 5)
      headers = response.response_header
      return Rhinestone::Response.new(headers.status,
                                      header_filter.filter(headers),
                                      response.response)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rhinestone-0.0.2 lib/rhinestone/http_client.rb
rhinestone-0.0.1 lib/rhinestone/http_client.rb