def initialize(url, options = {})
@method = options[:method] || :get
@params = options[:params]
@body = options[:body]
@timeout = options[:timeout]
@connect_timeout = options[:connect_timeout]
@headers = options[:headers] || {}
@user_agent = options[:user_agent] || Typhoeus::USER_AGENT
@cache_timeout = options[:cache_timeout]
@follow_location = options[:follow_location]
@max_redirects = options[:max_redirects]
@proxy = options[:proxy]
@disable_ssl_peer_verification = options[:disable_ssl_peer_verification]
@ssl_cert = options[:ssl_cert]
@ssl_cert_type = options[:ssl_cert_type]
@ssl_key = options[:ssl_key]
@ssl_key_type = options[:ssl_key_type]
@ssl_key_password = options[:ssl_key_password]
@ssl_cacert = options[:ssl_cacert]
@ssl_capath = options[:ssl_capath]
@verbose = options[:verbose]
@username = options[:username]
@password = options[:password]
@auth_method = options[:auth_method]
if @method == :post
@url = url
else
@url = @params ? "#{url}?#{params_string}" : url
end
@parsed_uri = URI.parse(@url)
@on_complete = nil
@after_complete = nil
@handled_response = nil
end