mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
b1a0509b54
deflate-encoded response bodies. [Feature #6942] * lib/net/http/generic_request.rb: Automatically accept gzip and deflate content-encoding for requests. [Feature #6494] * lib/net/http/request.rb: Updated documentation for #6494. * lib/net/http.rb: Updated documentation for #6492 and #6494, removed Content-Encoding handling now present in Net::HTTPResponse. * test/net/http/test_httpresponse.rb: Tests for #6492 * test/net/http/test_http_request.rb: Tests for #6494 * test/open-uri/test_open-uri.rb (test_content_encoding): Updated test for automatic content-encoding handling. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
20 lines
715 B
Ruby
20 lines
715 B
Ruby
# HTTP request class.
|
|
# This class wraps together the request header and the request path.
|
|
# You cannot use this class directly. Instead, you should use one of its
|
|
# subclasses: Net::HTTP::Get, Net::HTTP::Post, Net::HTTP::Head.
|
|
#
|
|
class Net::HTTPRequest < Net::HTTPGenericRequest
|
|
# 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+.
|
|
|
|
def initialize(path, initheader = nil)
|
|
super self.class::METHOD,
|
|
self.class::REQUEST_HAS_BODY,
|
|
self.class::RESPONSE_HAS_BODY,
|
|
path, initheader
|
|
end
|
|
end
|
|
|