class Protocol::HTTP::Body::Streamable::RequestBody

As the response body isn’t available until the request is sent, the response body must be {stream}ed into the request body.
A request body is used on the client side to generate the request body using a block.

def close(error = nil)

Close will be invoked when all the input is read.
def close(error = nil)
	self.close_input(error)
end

def initialize(block)

@parameter block [Proc] The block that generates the body.

Initialize the request body with the given block.
def initialize(block)
	super(block, Writable.new)
end

def stream(body)

Stream the response body into the block's input.
def stream(body)
	body&.each do |chunk|
		@input.write(chunk)
	end
rescue => error
ensure
	@input.close_write(error)
end