Module: UU::OS::HTTP::MultipartParser

Defined in:
uu_os_connection-2.2.4/lib/uu/os/http/multipart_parser.rb

Overview

Module providing methods for multipart request parsing.

Instance Method Summary (collapse)

Instance Method Details

- (Array<Hash<Symbol,Object>>) parse_multipart(body, boundary, binary_name = nil)

Parses multipart body.

Parameters:

  • body (String, IO)

    Multipart request body

  • boundary (String)

    Multipart item boundary

  • binary_name (Symbol, String) (defaults to: nil)

    Name of attribute containing large binary data. In case attribute with this name is found, its content is returned as stream and rest of multipart body is dumped (binary attribute should be always the last item of multipart body).

Returns:

  • (Array<Hash<Symbol,Object>>)

    Parsed multipart request in for of Array of Hashes. Each Hash represents one form item with attributes :name (item name), :filename (optional), :content_type (optional) and :body (String or IO based on binary_name parameter).



21
22
23
# File 'uu_os_connection-2.2.4/lib/uu/os/http/multipart_parser.rb', line 21

def parse_multipart(body, boundary, binary_name = nil)
  MultipartParser.parse_multipart(body, boundary, binary_name)
end