Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Net::HTTPGenericRequest#body_stream=
(untyped body_stream) -> untyped
body_stream=(input)
lib/net/http/generic_request.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/net/http/generic_request.rb, line 179
def body_stream=(input)
@body = nil
@body_stream = input
@body_data = nil
input
end
Sets the body stream for the request:
Example
req = Net::HTTP::Post.new(uri) # => #<Net::HTTP::Post POST> req.body_stream # => nil require 'stringio' req.body_stream = StringIO.new('xyzzy') # => #<StringIO:0x0000027d1e5affa8> req.body_stream # => #<StringIO:0x0000027d1e5affa8>