Class: Net::HTTPRequest

Inherits:
HTTPGenericRequest show all
Defined in:
lib/net/http/request.rb

Overview

This class is the base class for Net::HTTP request classes; it wraps together the request path and the request headers.

The class should not be used directly; instead you should use its subclasses.

Subclasses for HTTP requests:

  • Net::HTTP::Get

  • Net::HTTP::Head

  • Net::HTTP::Post

  • Net::HTTP::Put

  • Net::HTTP::Delete

  • Net::HTTP::Options

  • Net::HTTP::Trace

  • Net::HTTP::Patch

Subclasses for WebDAV requests:

  • Net::HTTP::Propfind

  • Net::HTTP::Proppatch

  • Net::HTTP::Mkcol

  • Net::HTTP::Copy

  • Net::HTTP::Move

  • Net::HTTP::Lock

  • Net::HTTP::Unlock

Instance Attribute Summary

Attributes inherited from HTTPGenericRequest

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

Instance Method Summary collapse

Methods inherited from HTTPGenericRequest

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

Methods included from 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

#initialize(path, initheader = nil) ⇒ HTTPRequest

Creates an HTTP request object for path.

initheader are the default headers to use. Net::HTTP adds Accept-Encoding to enable compression of the response body unless Accept-Encoding or Range are supplied in initheader.



37
38
39
40
41
42
# File 'lib/net/http/request.rb', line 37

def initialize(path, initheader = nil)
  super self.class::METHOD,
        self.class::REQUEST_HAS_BODY,
        self.class::RESPONSE_HAS_BODY,
        path, initheader
end