method
send_request_with_body_stream
send_request_with_body_stream(sock, ver, path, f)
private
Hide source
# File lib/net/http.rb, line 1551 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 if chunked? while s = f.read(BUFSIZE) sock.write(sprintf("%x\r\n", s.length) << s << "\r\n") end sock.write "0\r\n\r\n" else while s = f.read(BUFSIZE) sock.write s end end end