Method: Serverspec::Type#http_get

Defined in:
lib/serverspec_extended_types/http_get.rb

#http_get(port, host_header, path, timeout_sec = 10, protocol = 'http', bypass_ssl_verify = false) ⇒ Serverspec::Type::Http_Get

ServerSpec Type wrapper for http_get

Examples:

describe http_get(80, 'myhostname', '/') do
  # tests here
end

Parameters:

  • port (Int)

    the port to connect to HTTP over

  • host_header (String)

    the value to set in the ‘Host’ HTTP request header

  • path (String)

    the URI/path to request from the server

  • timeout_sec (Int) (defaults to: 10)

    how many seconds to allow request to run before timing out and setting @timed_out_status to True

  • protocol (String) (defaults to: 'http')

    the protocol to connect to the server (default ‘http’, can be ‘https’)

  • bypass_ssl_verify (Boolean) (defaults to: false)

    if true, SSL verification will be bypassed (useful for self-signed certificates)

Returns:



215
216
217
# File 'lib/serverspec_extended_types/http_get.rb', line 215

def http_get(port, host_header, path, timeout_sec=10, protocol='http', bypass_ssl_verify=false)
  Http_Get.new(port, host_header, path, timeout_sec, protocol, bypass_ssl_verify)
end