Method: Grubby#ok?
- Defined in:
- lib/grubby.rb
#ok?(uri, query_params = {}, headers = {}) ⇒ Boolean
Calls #head and returns true if a response code "200" is received,
false otherwise. Unlike #head, error response codes (e.g. "404",
"500") do not result in a Mechanize::ResponseCodeError being
raised.
118 119 120 121 122 123 124 |
# File 'lib/grubby.rb', line 118 def ok?(uri, query_params = {}, headers = {}) begin head(uri, query_params, headers).code == "200" rescue Mechanize::ResponseCodeError false end end |