Method: What::Modules::Http#check

Defined in:
lib/what/modules/http.rb

#checkObject



13
14
15
16
17
18
19
20
# File 'lib/what/modules/http.rb', line 13

def check
  resp = Net::HTTP.get_response(@url)
  @status = resp.code.to_i
  @body = resp.body.strip
  @got_response = true
rescue Net::ReadTimeout => e
  @got_response = false
end