maxwell v2.2.3 Maxwell.Multipart
Process mutipart for adapter
Link to this section Summary
Functions
multipart form encode
multipart form encode
Get the size of a mp stream. Useful to calculate the content-length of a full multipart stream and send it as an identity
create a multipart struct
Return a random boundary(binary)
Link to this section Types
Link to this type
header_t()
Link to this type
part_t()
part_t() ::
{:file, Path.t()}
| {:file, Path.t(), headers_t()}
| {:file, Path.t(), disposition_t(), headers_t()}
| {:file_content, file_content_t(), String.t()}
| {:file_content, file_content_t(), String.t(), headers_t()}
| {:file_content, file_content_t(), String.t(), disposition_t(), headers_t()}
| {:mp_mixed, String.t(), boundary_t()}
| {:mp_mixed_eof, boundary_t()}
| {name_t(), binary()}
| {name_t(), binary(), headers_t()}
| {name_t(), binary(), disposition_t(), headers_t()}
Link to this section Functions
Link to this function
add_field(multipart, name, value, extra_headers)
Link to this function
add_field(multipart, name, value, disposition, extra_headers)
Link to this function
add_file(multipart, path, extra_headers)
Link to this function
add_file(multipart, path, disposition, extra_headers)
add_file(t(), Path.t(), disposition_t(), headers_t()) :: t()
Link to this function
add_file_content(multipart, file_content, filename)
add_file_content(t(), file_content_t(), String.t()) :: t()
Link to this function
add_file_content(multipart, file_content, filename, extra_headers)
add_file_content(t(), file_content_t(), String.t(), headers_t()) :: t()
Link to this function
add_file_content(multipart, file_content, filename, disposition, extra_headers)
add_file_content( t(), file_content_t(), String.t(), disposition_t(), headers_t() ) :: t()
Link to this function
add_file_content_with_name(multipart, file_content, filename, name, extra_headers \\ [])
Link to this function
add_file_with_name(multipart, path, name, extra_headers \\ [])
Link to this function
encode_form(parts)
encode_form(parts :: [part_t()]) :: {boundary_t(), integer()}
multipart form encode.
* `parts` - receives lists list's member format:
1. `{:file, path}`
2. `{:file, path, extra_headers}`
3. `{:file, path, disposition, extra_headers}`
4. `{:file_content, file_content, filename}`
5. `{:file_content, file_content, filename, extra_headers}`
6. `{:file_content, file_content, filename, disposition, extra_headers}`
7. `{:mp_mixed, name, mixed_boundary}`
8. `{:mp_mixed_eof, mixed_boundary}`
9. `{name, bin_data}`
10. `{name, bin_data, extra_headers}`
11. `{name, bin_data, disposition, extra_headers}`
Returns {body_binary, size}
Link to this function
encode_form(boundary, parts)
encode_form(boundary :: boundary_t(), parts :: [part_t()]) :: {boundary_t(), integer()}
multipart form encode.
boundary- multipart boundary.parts- receives lists list’s member format:{:file, path}{:file, path, extra_headers}{:file, path, disposition, extra_headers}{:file_content, file_content, filename}{:file_content, file_content, filename, extra_headers}{:file_content, file_content, filename, disposition, extra_headers}{:mp_mixed, name, mixed_boundary}{:mp_mixed_eof, mixed_boundary}{name, bin_data}{name, bin_data, extra_headers}{name, bin_data, disposition, extra_headers}
Link to this function
len_mp_stream(boundary, parts)
len_mp_stream(boundary :: boundary_t(), parts :: [part_t()]) :: integer()
Get the size of a mp stream. Useful to calculate the content-length of a full multipart stream and send it as an identity
* `boundary` - multipart boundary
* `parts` - see `Maxwell.Multipart.encode_form`.
Returns stream size(integer)
create a multipart struct