class Gem::Net::HTTP::Head
Class for representing HTTP method HEAD:
require 'rubygems/vendor/net-http/lib/net/http' uri = Gem::URI('http://example.com') hostname = uri.hostname # => "example.com" req = Gem::Net::HTTP::Head.new(uri) # => #<Gem::Net::HTTP::Head HEAD> res = Gem::Net::HTTP.start(hostname) do |http| http.request(req) end
See Request Headers.
Properties:
-
Request body: optional.
-
Response body: no.
-
Safe: yes.
-
Idempotent: yes.
-
Cacheable: yes.
Related:
-
Gem::Net::HTTP#head
: sendsHEAD
request, returns response object.
Constants
- METHOD
- REQUEST_HAS_BODY
- RESPONSE_HAS_BODY