Method: Puppet::Indirector::REST#head

Defined in:
lib/vendor/puppet/indirector/rest.rb

#head(request) ⇒ Object



131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/vendor/puppet/indirector/rest.rb', line 131

def head(request)
  response = http_head(request, indirection2uri(request), headers)
  case response.code
  when "404"
    return false
  when /^2/
    return true
  else
    # Raise the http error if we didn't get a 'success' of some kind.
    raise convert_to_http_error(response)
  end
end