Multipart.Part (Multipart v0.6.0)
View SourceRepresents an individual part of a Multipart message.
Summary
Functions
Builds a Part with a binary body.
Builds a Part with a streaming file body.
Builds a form-data Part with an in-memory file body.
Builds a form-data Part with a streaming file body.
Builds a Part with a Stream body.
Builds a form-data Part with a streaming body.
Builds a form-data Part with a text body.
Types
Functions
Builds a Part with a binary body.
Set the content_length of the Part to the length of the binary.
Builds a Part with a streaming file body.
Set the content_length of the Part to the size of the file on disk, as
inspected with File.stat.
Builds a form-data Part with an in-memory file body.
Takes the following Keyword options in opts:
filename: controls the inclusion of thefilename="foo"directive in thecontent-dispositionheader. Defaults totrue, which uses the filename from the path on disk. Pass in aStringto override this, or set tofalseto disable this directive.content_type: controls the inclusion of thecontent-typeheader. Defaults totruewhich will useMIME.from_path/1to detect the mime type of the file. Pass in aStringto override this, or set tofalseto disable this header.
Builds a form-data Part with a streaming file body.
Takes the following Keyword options in opts:
filename: controls the inclusion of thefilename="foo"directive in thecontent-dispositionheader. Defaults totrue, which uses the filename from the path on disk. Pass in aStringto override this, or set tofalseto disable this directive.content_type: controls the inclusion of thecontent-typeheader. Defaults totruewhich will useMIME.from_path/1to detect the mime type of the file. Pass in aStringto override this, or set tofalseto disable this header.
Builds a Part with a Stream body.
Because the length of the Stream cannot be known up front it doesn't
define the content_length. This will cause Multipart.content_length/1
to error unless you set the content_length manually in the struct.
Builds a form-data Part with a streaming body.
Builds a form-data Part with a text body.