headers() = [{iodata(), iodata()}]
| boundary/0 | Generate a new random boundary. |
| close/1 | Return the closing delimiter of the multipart message. |
| first_part/2 | Return the first part's head. |
| form_data/1 | Convenience function for extracting information from headers when parsing a multipart/form-data stream. |
| parse_body/2 | Parse the body of the current multipart part. |
| parse_content_disposition/1 | Parse an RFC 2183 content-disposition value. |
| parse_content_transfer_encoding/1 | Parse an RFC 2045 content-transfer-encoding header. |
| parse_content_type/1 | Parse an RFC 2045 content-type header. |
| parse_headers/2 | Parse the headers for the next multipart part. |
| part/2 | Return a part's head. |
boundary() -> binary()
Generate a new random boundary.
The boundary generated has a low probability of ever appearing in the data.close(Boundary::binary()) -> iodata()
Return the closing delimiter of the multipart message.
first_part(Boundary::binary(), Headers::headers()) -> iodata()
Return the first part's head.
This works exactly like the part/2 function except there is no leading \r\n. It's not required to use this function, just makes the output a little smaller and prettier.form_data(Headers::headers() | #{binary() => binary()}) -> {data, binary()} | {file, binary(), binary(), binary()}
Convenience function for extracting information from headers when parsing a multipart/form-data stream.
parse_body(Stream::binary(), Boundary::binary()) -> {ok, binary()} | {ok, binary(), binary()} | done | {done, binary()} | {done, binary(), binary()}
Parse the body of the current multipart part.
The body is everything until the next boundary.parse_content_disposition(Bin::binary()) -> {binary(), [{binary(), binary()}]}
Parse an RFC 2183 content-disposition value.
parse_content_transfer_encoding(Bin::binary()) -> binary()
Parse an RFC 2045 content-transfer-encoding header.
parse_content_type(Bin::binary()) -> {binary(), binary(), [{binary(), binary()}]}
Parse an RFC 2045 content-type header.
parse_headers(Stream::binary(), Boundary::binary()) -> more | {more, binary()} | {ok, headers(), binary()} | {done, binary()}
Parse the headers for the next multipart part.
This function skips any preamble before the boundary. The preamble may be retrieved using parse_body/2.
This function will accept input of any size, it is up to the caller to limit it if needed.part(Boundary::binary(), Headers::headers()) -> iodata()
Return a part's head.
Generated by EDoc