def get(path, initheader = {}, dest = nil, &block) # :yield: +body_segment+
      res = nil
      if HAVE_ZLIB
        unless  initheader.keys.any?{|k| k.downcase == "accept-encoding"}
          initheader["accept-encoding"] = "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
          @compression = true
        end
      end
      request(Get.new(path, initheader)) {|r|
        if r.key?("content-encoding") and @compression
          @compression = nil # Clear it till next set.
          the_body = r.read_body dest, &block
          case r["content-encoding"]
          when "gzip"
            r.body= Zlib::GzipReader.new(StringIO.new(the_body)).read
            r.delete("content-encoding")
          when "deflate"
            r.body= Zlib::Inflate.inflate(the_body);
            r.delete("content-encoding")
          when "identity"
            ; # nothing needed
          else
            ; # Don't do anything dramatic, unless we need to later
          end
        else
          r.read_body dest, &block
        end
        res = r
      }
      unless @newimpl
        res.value
        return res, res.body
      end

      res
    end
def get(path, initheader = {}, dest = nil, &block) # :yield: +body_segment+
      res = nil
      if HAVE_ZLIB
        unless  initheader.keys.any?{|k| k.downcase == "accept-encoding"}
          initheader["accept-encoding"] = "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
          @compression = true
        end
      end
      request(Get.new(path, initheader)) {|r|
        if r.key?("content-encoding") and @compression
          @compression = nil # Clear it till next set.
          the_body = r.read_body dest, &block
          case r["content-encoding"]
          when "gzip"
            r.body= Zlib::GzipReader.new(StringIO.new(the_body)).read
            r.delete("content-encoding")
          when "deflate"
            r.body= Zlib::Inflate.inflate(the_body);
            r.delete("content-encoding")
          when "identity"
            ; # nothing needed
          else
            ; # Don't do anything dramatic, unless we need to later
          end
        else
          r.read_body dest, &block
        end
        res = r
      }
      unless @newimpl
        res.value
        return res, res.body
      end

      res
    end
Gets data from +path+ on the connected-to host.
 +initheader+ must be a Hash like { 'Accept' => '*/*', ... },
 and it defaults to an empty hash.
 If +initheader+ doesn't have the key 'accept-encoding', then
 a value of "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" is used,
 so that gzip compression is used in preference to deflate
 compression, which is used in preference to no compression.
 Ruby doesn't have libraries to support the compress (Lempel-Ziv)
 compression, so that is not supported.  The intent of this is
 to reduce bandwidth by default.   If this routine sets up
 compression, then it does the decompression also, removing
 the header as well to prevent confusion.  Otherwise
 it leaves the body as it found it.

 In version 1.1 (ruby 1.6), this method returns a pair of objects,
 a Net::HTTPResponse object and the entity body string.
 In version 1.2 (ruby 1.8), this method returns a Net::HTTPResponse
 object.

 If called with a block, yields each fragment of the
 entity body in turn as a string as it is read from
 the socket.  Note that in this case, the returned response
 object will *not* contain a (meaningful) body.

 +dest+ argument is obsolete.
 It still works but you must not use it.

 In version 1.1, this method might raise an exception for
 3xx (redirect). In this case you can get a HTTPResponse object
 by "anException.response".

 In version 1.2, this method never raises exception.

     # version 1.1 (bundled with Ruby 1.6)
     response, body = http.get('/index.html')

     # version 1.2 (bundled with Ruby 1.8 or later)
     response = http.get('/index.html')

     # using block
     File.open('result.txt', 'w') {|f|
       http.get('/~foo/') do |str|
         f.write str
       end
     }