Module: Faraday::Multipart

Defined in:
lib/faraday/multipart.rb,
lib/faraday/multipart/version.rb,
lib/faraday/multipart/file_part.rb,
lib/faraday/multipart/middleware.rb,
lib/faraday/multipart/param_part.rb

Overview

Main Faraday::Multipart module.

Defined Under Namespace

Classes: CompositeReadIO, Middleware, ParamPart

Constant Summary collapse

VERSION =
'1.0.3'
FilePart =

The uploaded binary data’s content type.

The base filename, taken either from the filename_or_io or filename arguments in #initialize.

Extra String key/value pairs to make up the header for this uploaded file.

The open IO object for the uploaded file.

Returns:

::UploadIO
Parts =
::Parts

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#content_typeFaraday::FilePart, ... (readonly)

The uploaded binary data’s content type.

The base filename, taken either from the filename_or_io or filename arguments in #initialize.

Extra String key/value pairs to make up the header for this uploaded file.

The open IO object for the uploaded file.

Returns:



54
# File 'lib/faraday/multipart/file_part.rb', line 54

FilePart = ::UploadIO

#ioFaraday::FilePart, ... (readonly)

The uploaded binary data’s content type.

The base filename, taken either from the filename_or_io or filename arguments in #initialize.

Extra String key/value pairs to make up the header for this uploaded file.

The open IO object for the uploaded file.

Returns:



54
# File 'lib/faraday/multipart/file_part.rb', line 54

FilePart = ::UploadIO

#optsFaraday::FilePart, ... (readonly)

The uploaded binary data’s content type.

The base filename, taken either from the filename_or_io or filename arguments in #initialize.

Extra String key/value pairs to make up the header for this uploaded file.

The open IO object for the uploaded file.

Returns:



54
# File 'lib/faraday/multipart/file_part.rb', line 54

FilePart = ::UploadIO

#original_filenameFaraday::FilePart, ... (readonly)

The uploaded binary data’s content type.

The base filename, taken either from the filename_or_io or filename arguments in #initialize.

Extra String key/value pairs to make up the header for this uploaded file.

The open IO object for the uploaded file.

Returns:



54
# File 'lib/faraday/multipart/file_part.rb', line 54

FilePart = ::UploadIO

Instance Method Details

#initialize(filename_or_io, content_type, filename = nil, opts = {}) ⇒ Object

Parameters:

  • filename_or_io (String, IO)

    Either a String filename to a local file or an open IO object.

  • content_type (String)

    String content type of the file data.

  • filename (String) (defaults to: nil)

    Optional String filename, usually to add context to a given IO object.

  • opts (Hash) (defaults to: {})

    Optional Hash of String key/value pairs to describethis this uploaded file. Expected Header keys include:

    • Content-Transfer-Encoding - Defaults to “binary”

    • Content-Disposition - Defaults to “form-data”

    • Content-Type - Defaults to the content_type argument.

    • Content-ID - Optional.



54
# File 'lib/faraday/multipart/file_part.rb', line 54

FilePart = ::UploadIO