method
send_request_with_body_stream
v1_9_2_180 -
Show latest stable
- Class:
Net::HTTPGenericRequest
send_request_with_body_stream(sock, ver, path, f)private
No documentation available.
# File lib/net/http.rb, line 1742
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(1024)
sock.write(sprintf("%x\r\n", s.length) << s << "\r\n")
end
sock.write "0\r\n\r\n"
else
while s = f.read(1024)
sock.write s
end
end
end