module M2R::Base

Logic for typical Mongrel2 request with no fancy features such as async upload

@private

Public Instance Methods

body_io() click to toggle source

@return [StringIO] Request body encapsulated in IO compatible object @api public

# File lib/m2r/request/base.rb, line 9
def body_io
  @body_io ||= begin
    b = StringIO.new(body)
    b.set_encoding(Encoding::BINARY) if b.respond_to?(:set_encoding)
    b
  end
end
free!() click to toggle source

@return [nil] Free external resources such as files or sockets @api public

# File lib/m2r/request/base.rb, line 19
def free!
  body_io.close
end