Class: Gem::Net::HTTP::Head

Inherits:
Gem::Net::HTTPRequest show all
Defined in:
lib/rubygems/vendor/net-http/lib/net/http/requests.rb

Overview

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:

Related:

  • Gem::Net::HTTP#head: sends HEAD request, returns response object.

Constant Summary collapse

METHOD =
'HEAD'
REQUEST_HAS_BODY =
false
RESPONSE_HAS_BODY =
false

Constants included from Gem::Net::HTTPHeader

Gem::Net::HTTPHeader::MAX_FIELD_LENGTH, Gem::Net::HTTPHeader::MAX_KEY_LENGTH

Instance Attribute Summary

Attributes inherited from Gem::Net::HTTPGenericRequest

#body, #body_stream, #decode_content, #method, #path, #uri

Method Summary

Methods inherited from Gem::Net::HTTPRequest

#initialize

Methods inherited from Gem::Net::HTTPGenericRequest

#[]=, #body_exist?, #exec, #initialize, #inspect, #request_body_permitted?, #response_body_permitted?, #set_body_internal, #update_uri

Methods included from Gem::Net::HTTPHeader

#[], #[]=, #add_field, #basic_auth, #chunked?, #connection_close?, #connection_keep_alive?, #content_length, #content_length=, #content_range, #content_type, #delete, #each_capitalized, #each_capitalized_name, #each_header, #each_name, #each_value, #fetch, #get_fields, #initialize_http_header, #key?, #main_type, #proxy_basic_auth, #range, #range_length, #set_content_type, #set_form, #set_form_data, #set_range, #size, #sub_type, #to_hash, #type_params

Constructor Details

This class inherits a constructor from Gem::Net::HTTPRequest