appconnect_time()
click to toggle source
Return the time, in seconds, it took from the start until the SSL/SSH
connect/handshake to the remote host was completed. This time is most often
very near to the pre transfer time, except for cases such as HTTP
pippelining where the pretransfer time can be delayed due to waits in line
for the pipeline and more.
@example Get appconnect_time.
response.appconnect_time
@return [ Float ] The appconnect_time.
def appconnect_time
options[:appconnect_time] || options[:app_connect_time]
end
body()
click to toggle source
connect_time()
click to toggle source
Return the time, in seconds, it took from the start until the connect to
the remote host (or proxy) was completed.
@example Get connect_time.
response.connect_time
@return [ Float ] The connect_time.
def connect_time
options[:connect_time]
end
effective_url()
click to toggle source
Return the last used effective url.
@example Get effective_url.
response.effective_url
@return [ String ] The effective_url.
def effective_url
options[:effective_url]
end
httpauth_avail()
click to toggle source
Return the available http auth methods. Bitmask indicating the
authentication method(s) available.
@example Get httpauth_avail.
response.httpauth_avail
@return [ Integer ] The bitmask.
def httpauth_avail
options[:httpauth_avail]
end
namelookup_time()
click to toggle source
Return the time, in seconds, it took from the start until the name
resolving was completed.
@example Get namelookup_time.
response.namelookup_time
@return [ Float ] The namelookup_time.
def namelookup_time
options[:namelookup_time] || options[:name_lookup_time]
end
pretransfer_time()
click to toggle source
Return the time, in seconds, it took from the start until the file transfer
is just about to begin. This includes all pre-transfer commands and
negotiations that are specific to the particular protocol(s) involved. It
does not involve the sending of the protocol- specific request that
triggers a transfer.
@example Get pretransfer_time.
response.pretransfer_time
@return [ Float ] The pretransfer_time.
def pretransfer_time
options[:pretransfer_time]
end
primary_ip()
click to toggle source
Return the string holding the IP address of the most recent connection done
with this curl handle. This string may be IPv6 if that's enabled.
@example Get primary_ip.
response.primary_ip
@return [ String ] The primary_ip.
def primary_ip
options[:primary_ip]
end
redirect_count()
click to toggle source
Return the total number of redirections that were actually followed
@example Get redirect_count.
response.redirect_count
@return [ Integer ] The redirect_count.
def redirect_count
options[:redirect_count]
end
redirections()
click to toggle source
Return all redirections in between as multiple responses with header.
@example Return redirections.
response.redirections
@return [ Array<Typhoeus::Response> ] The redirections
def redirections
return [] unless response_headers
response_headers.split("\r\n\r\n")[0..-2].map{ |h| Response.new(:response_headers => h) }
end
response_body()
click to toggle source
Return the http response body.
@example Get response_body.
response.response_body
@return [ String ] The response_body.
def response_body
options[:response_body] || options[:body]
end
response_code()
click to toggle source
Return the last received HTTP, FTP or SMTP response code. The value will be
zero if no server response code has been received. Note that a proxy's
CONNECT response should be read with http_connect_code and not this.
@example Get response_code.
response.response_code
@return [ Integer ] The response_code.
def response_code
(options[:response_code] || options[:code]).to_i
end
return_code()
click to toggle source
Return libcurls return value.
@example Get return_code.
response.return_code
@return [ Symbol ] The return_code.
def return_code
options[:return_code]
end
return_message()
click to toggle source
Returns a string describing the return.
@example Get return_message.
response.return_message
@return [ String ] The return_message.
@since 0.6.2
def return_message
Ethon::Curl.easy_strerror(return_code)
end
starttransfer_time()
click to toggle source
Return the time, in seconds, it took from the start until the first byte is
received by libcurl. This includes pretransfer time and also the time the
server needs to calculate the result.
@example Get starttransfer_time.
response.starttransfer_time
@return [ Float ] The starttransfer_time.
def starttransfer_time
options[:starttransfer_time] || options[:start_transfer_time]
end
total_time()
click to toggle source
Return the total time in seconds for the previous transfer, including name
resolving, TCP connect etc.
@example Get total_time.
response.total_time
@return [ Float ] The total_time.
def total_time
options[:total_time] || options[:time]
end