send_request_with_body_stream(sock, ver, path, f) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/net/http/generic_request.rb, line 187
  def send_request_with_body_stream(sock, ver, path, f)
    unless content_length() or chunked?
      raise ArgumentError,
          "Content-Length not given and Transfer-Encoding is not `chunked'"
    end
    supply_default_content_type
    write_header sock, ver, path
    wait_for_continue sock, ver if sock.continue_timeout
    if chunked?
      chunker = Chunker.new(sock)
      IO.copy_stream(f, chunker)
      chunker.finish
    else
      # copy_stream can sendfile() to sock.io unless we use SSL.
      # If sock.io is an SSLSocket, copy_stream will hit SSL_write()
      IO.copy_stream(f, sock.io)
    end
  end
Register or log in to add new notes.