Karta. Inbound. Encoding
(Karta v1.0.0)
The bytes of the request bodies Karta sends for received mail, encoded as the formats it imitates encode them:
base64_lines/1- base64 in lines of 60 characters, each ended by a line feed, as Ruby'sBase64.encode64writes it (Postal's formats);form/1-application/x-www-form-urlencoded, as Ruby'sURI.encode_www_formwrites it: letters, digits and*-._as they are, a space as+, every other byte as%XX; anilvalue is the name alone (name, notname=), and a list repeats the name once per value (an empty list is left out, where Ruby writes a stray&);multipart/1-multipart/form-data(SendGrid's format, and Mailgun's when the message has attachments).
Summary
Functions
Base64 in lines of 60 characters, each ended by a line feed, as Ruby's
Base64.encode64 (and so Postal) writes it.
Form data as Ruby's URI.encode_www_form writes it (see the module
doc). A value that is an integer, a float or a boolean is written as
to_string/1 writes it, as Ruby's to_s does.
A multipart/form-data request body and its content type.
Functions
Base64 in lines of 60 characters, each ended by a line feed, as Ruby's
Base64.encode64 (and so Postal) writes it.
Form data as Ruby's URI.encode_www_form writes it (see the module
doc). A value that is an integer, a float or a boolean is written as
to_string/1 writes it, as Ruby's to_s does.
A multipart/form-data request body and its content type.
Each part is a map with :name and :data, and optionally :filename
and :content_type (a file part). boundary: fixes the boundary (tests
use it); otherwise it is random, which keeps it out of any part.