Class: Net::HTTPGenericRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/nerdz/rebinds.rb

Instance Method Summary collapse

Constructor Details

#initialize(m, reqbody, resbody, path, initheader = nil) ⇒ HTTPGenericRequest

Returns a new instance of HTTPGenericRequest.

Raises:

  • (ArgumentError)


86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/nerdz/rebinds.rb', line 86

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 Nerdz #{Nerdz::VERSION}"
  @body = nil
  @body_stream = nil
end