Protocol::HTTPSourceProtocolHTTPBodyStreamableRequestBody

class RequestBody

A request body is used on the client side to generate the request body using a block.

As the response body isn't available until the request is sent, the response body must be Protocol::HTTP::Body::Streamable::RequestBody#streamed into the request body.

Definitions

def stream(body)

Stream the response body into the block's input.

Implementation

def stream(body)
	body&.each do |chunk|
		@input.write(chunk)
	end
rescue => error
ensure
	@input.close_write(error)
end