ivar v0.2.0 Ivar.Files
Ivar.Files
manages the files to be sent for a request
Summary
Functions
Puts the given files
into the existing request
map
Functions
Puts the given files
into the existing request
map
Args
request
- the map used to store the map of headers, usually created viaIvar.new/2
files
- the files to be put into the files list
Files
- tuple -
{"field_name", "some iodata", "file_name.txt", "text"}
- list - a list of tuples in the same format as above
Usage
file_data = File.read!("/some/image.png")
Ivar.Files.put(%{}, {"file", file_data, "image.png", "png"})
# %{files: [{"file", <<1, 2, 3, ...>>, {"form-data", [{"name", "file"}, {"filename", "image.png"}]}, [{"content-type", "image/png"}]}]}