class Protocol::HTTP::Body::Completable
def self.wrap(message, &block)
@parameter message [Request | Response] the message body.
Wrap a message body with a callback. If the body is empty, the callback is invoked immediately.
def self.wrap(message, &block) if body = message&.body and !body.empty? message.body = self.new(message.body, block) else yield end end