tesla v0.8.0 Tesla.Multipart View Source
Multipart functionality.
Example:
mp =
Multipart.new
|> Multipart.add_content_type_param("charset=utf-8")
|> Multipart.add_field("field1", "foo")
|> Multipart.add_field("field2", "bar", headers: [{:"Content-Id", 1}, {:"Content-Type", "text/plain"}])
|> Multipart.add_file("test/tesla/multipart_test_file.sh")
|> Multipart.add_file("test/tesla/multipart_test_file.sh", name: "foobar")
response = client.post(url, mp)
Link to this section Summary
Functions
Add a parameter to the multipart content-type
Add a field part
Add a file part. The file will be streamed
Create a new Multipart struct to be used for a request body
Link to this section Types
Link to this section Functions
Add a parameter to the multipart content-type.
Link to this function
add_field(mp, name, value, opts \\ [])
View Source
add_field(t, String.t, part_value, Keyword.t) :: t
Add a field part.
Add a file part. The file will be streamed.
Create a new Multipart struct to be used for a request body.