Method: OkComputer::HttpCheck#perform_request

Defined in:
lib/ok_computer/built_in_checks/http_check.rb

#perform_requestObject

Public: Actually performs the request against the URL. Returns response body if the request was successful. Otherwise raises a HttpCheck::ConnectionFailed error.



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/ok_computer/built_in_checks/http_check.rb', line 36

def perform_request
  Timeout.timeout(request_timeout) do
    options = { read_timeout: request_timeout }

    if basic_auth_options.any?
      options[:http_basic_authentication] = basic_auth_options
    end

    url.read(options)
  end
rescue => e
  raise ConnectionFailed, e
end