Object
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.
# File net/http.rb, line 1855
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
# File net/http.rb, line 1892
def body=(str)
@body = str
@body_stream = nil
@body_data = nil
str
end
# File net/http.rb, line 1885
def body_exist?
warn "Net::HTTPRequest#body_exist? is obsolete; use response_body_permitted?" if $VERBOSE
response_body_permitted?
end
# File net/http.rb, line 1901
def body_stream=(input)
@body = nil
@body_stream = input
@body_data = nil
input
end
# File net/http.rb, line 1873
def inspect
"\#<#{self.class} #{@method}>"
end
Commenting is here to help enhance the documentation. For example, sample code, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.