In Files

  • net/http.rb

Net::HTTPGenericRequest

HTTPGenericRequest is the parent of the HTTPRequest class. Do not use this directly; use a subclass of HTTPRequest.

Mixes in the HTTPHeader module to provide easier access to HTTP headers.

Attributes

body[R]
body_stream[R]
method[R]
path[R]

Public Class Methods

new(m, reqbody, resbody, path, initheader = nil) click to toggle source
 
               # File net/http.rb, line 1856
def initialize(m, reqbody, resbody, path, initheader = nil)
  @method = m
  @request_has_body = reqbody
  @response_has_body = resbody
  raise ArgumentError, "no HTTP request path given" unless path
  raise ArgumentError, "HTTP request path is empty" if path.empty?
  @path = path
  initialize_http_header initheader
  self['Accept'] ||= '*/*'
  self['User-Agent'] ||= 'Ruby'
  @body = nil
  @body_stream = nil
  @body_data = nil
end
            

Public Instance Methods

body=(str) click to toggle source
 
               # File net/http.rb, line 1893
def body=(str)
  @body = str
  @body_stream = nil
  @body_data = nil
  str
end
            
body_exist?() click to toggle source
 
               # File net/http.rb, line 1886
def body_exist?
  warn "Net::HTTPRequest#body_exist? is obsolete; use response_body_permitted?" if $VERBOSE
  response_body_permitted?
end
            
body_stream=(input) click to toggle source
 
               # File net/http.rb, line 1902
def body_stream=(input)
  @body = nil
  @body_stream = input
  @body_data = nil
  input
end
            
inspect() click to toggle source
 
               # File net/http.rb, line 1874
def inspect
  "\#<#{self.class} #{@method}>"
end
            
request_body_permitted?() click to toggle source
 
               # File net/http.rb, line 1878
def request_body_permitted?
  @request_has_body
end
            
response_body_permitted?() click to toggle source
 
               # File net/http.rb, line 1882
def response_body_permitted?
  @response_has_body
end