module Typhoeus::Response::Informations

def appconnect_time

Returns:
  • (Float) - The appconnect_time.

Other tags:
    Example: Get appconnect_time. -
def appconnect_time
  options[:appconnect_time] || options[:app_connect_time]
end

def connect_time

Returns:
  • (Float) - The connect_time.

Other tags:
    Example: Get connect_time. -
def connect_time
  options[:connect_time]
end

def debug_info

def debug_info
  options[:debug_info]
end

def effective_url

Returns:
  • (String) - The effective_url.

Other tags:
    Example: Get effective_url. -
def effective_url
  options[:effective_url]
end

def headers

Returns:
  • (Typhoeus::Header) - The response header.

Other tags:
    Example: Return headers. -
def headers
  return Header.new(options[:headers]) if mock? && options[:headers]
  return nil if response_headers.nil? && !defined?(@headers)
  @headers ||= Header.new(response_headers.split("\r\n\r\n").last)
end

def httpauth_avail

Returns:
  • (Integer) - The bitmask.

Other tags:
    Example: Get httpauth_avail. -
def httpauth_avail
  options[:httpauth_avail]
end

def namelookup_time

Returns:
  • (Float) - The namelookup_time.

Other tags:
    Example: Get namelookup_time. -
def namelookup_time
  options[:namelookup_time] || options[:name_lookup_time]
end

def pretransfer_time

Returns:
  • (Float) - The pretransfer_time.

Other tags:
    Example: Get pretransfer_time. -
def pretransfer_time
  options[:pretransfer_time]
end

def primary_ip

Returns:
  • (String) - The primary_ip.

Other tags:
    Example: Get primary_ip. -
def primary_ip
  options[:primary_ip]
end

def redirect_count

Returns:
  • (Integer) - The redirect_count.

Other tags:
    Example: Get redirect_count. -
def redirect_count
  options[:redirect_count]
end

def redirect_time

Returns:
  • (Float) - The redirect_time.

Other tags:
    Example: Get redirect_time. -
def redirect_time
  options[:redirect_time]
end

def redirections

Returns:
  • (Array) - The redirections

Other tags:
    Example: Return redirections. -
def redirections
  return [] unless response_headers
  response_headers.split("\r\n\r\n")[0..-2].map{ |h| Response.new(:response_headers => h) }
end

def request_size

def request_size
  options[:request_size]
end

def response_body

Returns:
  • (String) - The response_body.

Other tags:
    Example: Get response_body. -
def response_body
  options[:response_body] || options[:body]
end

def response_code

Returns:
  • (Integer) - The response_code.

Other tags:
    Example: Get response_code. -
def response_code
  (options[:response_code] || options[:code]).to_i
end

def response_headers

Returns:
  • (String) - The response_headers.

Other tags:
    Example: Get response_headers. -
def response_headers
  return options[:response_headers] if options[:response_headers]
  if mock? && h = options[:headers]
      status_code = return_code || "200"
      reason_phrase = status_code == "200" ? "OK" : "Mock Reason Phrase"
      status_line = "HTTP/1.1 #{status_code} #{reason_phrase}"
      actual_headers = h.map{ |k,v| [k, v.respond_to?(:join) ? v.join(',') : v] }.
        map{ |e| "#{e.first}: #{e.last}" }
      [status_line, *actual_headers].join("\r\n")
  end
end

def return_code

Returns:
  • (Symbol) - The return_code.

Other tags:
    Example: Get return_code. -
def return_code
  options[:return_code]
end

def return_message

Other tags:
    Since: - 0.6.2

Returns:
  • (String) - The return_message.

Other tags:
    Example: Get return_message. -
def return_message
  Ethon::Curl.easy_strerror(return_code) if return_code
end

def starttransfer_time

Returns:
  • (Float) - The starttransfer_time.

Other tags:
    Example: Get starttransfer_time. -
def starttransfer_time
  options[:starttransfer_time] || options[:start_transfer_time]
end

def total_time

Returns:
  • (Float) - The total_time.

Other tags:
    Example: Get total_time. -
def total_time
  options[:total_time] || options[:time]
end