### Home Classes Methods

### In Files

- lib/base/net_fix.rb

### Parent

Object

### Methods

- #request

### Files

- History.txt
- Manifest.txt
- README.txt
- Rakefile
- changelog
- compat
- control
- copyright
- rules
- format
- watch
- Rakefile
- index.txt
- serial
- passphrase.txt

### Class/Module Index

Quicksearch

- Net
- Net::HTTP
- Net::HTTPGenericRequest
- WEBrick
- WEBrick::AccessLog
- WEBrick::HTMLUtils
- Rightscale
- Rightscale::HttpConnection

No matching classes.

# Net::HTTP

### Public Instance Methods

request(req, body = nil) click to toggle source

    # File lib/base/net_fix.rb, line 145
    def request(req, body = nil, &block)  # :yield: +response+
      unless started?
        start {
          req['connection'] ||= 'close'
          return request(req, body, &block)
        }
      end
      if proxy_user()
        unless use_ssl?
          req.proxy_basic_auth proxy_user(), proxy_pass()
        end
      end
      # set body
      req.set_body_internal body
      begin_transport req
        # if we expect 100-continue then send a header first
        send_only = ((req.is_a?(Post)||req.is_a?(Put)) && (req['expect']=='100-continue')) ? :header : nil
        req.exec @socket, @curr_http_version, edit_path(req.path), send_only
        begin
          res = HTTPResponse.read_new(@socket)
          # if we expected 100-continue then send a body
          if res.is_a?(HTTPContinue) && send_only && req['content-length'].to_i > 0
            req.exec @socket, @curr_http_version, edit_path(req.path), :body
          end
        end while res.kind_of?(HTTPContinue)
        res.reading_body(@socket, req.response_body_permitted?) {
          yield res if block_given?
        }
      end_transport req, res
      res
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.