diff options
Diffstat (limited to 'lib/chef_zero/rest_base.rb')
-rw-r--r-- | lib/chef_zero/rest_base.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/chef_zero/rest_base.rb b/lib/chef_zero/rest_base.rb index 367ce70..74ca014 100644 --- a/lib/chef_zero/rest_base.rb +++ b/lib/chef_zero/rest_base.rb @@ -231,6 +231,16 @@ module ChefZero [response_code, { "Content-Type" => "text/plain" }, text] end + # rfc090 returns 404 error or 200 with an emtpy body + # @param [ChefZero::RestRequest] request The HTTP request object + # + # @return (see #json_response) + # + def head_request(request) + get_data(request) # will raise 404 if non-existant + json_response(200, nil) + end + # Returns an Array with the response code, HTTP headers, and JSON body. # # @param [Fixnum] response_code The HTTP response code |