Method: Net::HTTPGenericRequest#initialize

Defined in:
lib/jnlp/jnlp.rb

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

Returns a new instance of HTTPGenericRequest.

Raises:

  • (ArgumentError)


25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/jnlp/jnlp.rb', line 25

def initialize(m, reqbody, resbody, path, initheader = nil)
  @method = m
  @request_has_body = reqbody
  @response_has_body = resbody
  raise ArgumentError, "HTTP request path is empty" if path.empty?
  @path = path
  initialize_http_header initheader
  self['Accept'] ||= '*/*'
  self['User-Agent'] ||= 'Ruby' # this is the new line
  @body = nil
  @body_stream = nil
end