class

MIME::Message

Inherits Reference < Object

Main MIME message class

Constructors

new(headers : HTTP::Headers = HTTP::Headers.new, body : String = "", encoding : MIME::Encoding = Encoding::SevenBit)
Source
parse(data : String) : Message

Parse a MIME message from string

Source

Instance methods

body
Source
body=(body : String)
Source
content_type
Source
content_type=(value : String)

Set Content-Type header

Source
decode_body

Decode the message body according to the transfer encoding

Source
encode_body(data : String | Bytes) : String

Encode the message body according to the transfer encoding

Source
encoding
Source
encoding=(encoding : Encoding)
Source
headers
Source
headers=(headers : HTTP::Headers)
Source
to_s(io : IO) : Nil

Generate the complete MIME message

Source
to_s

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.

Source
transfer_encoding=(encoding : Encoding)

Set Content-Transfer-Encoding header

Source