Try Install Learn Blog API Packages GitHub
Pages
Standard Library

Search
Entities

FormData

Functions

addFile
(
key
:
String
value
:
File
formData
:
FormData
)
:
FormData

Returns a new FormData object copying all values from the given one and adding the given file with the given key.

FormData.empty()
|> FormData.addFile(
  "key", File.fromString("Contents", "text.txt", "text/plain"))
addString
(
key
:
String
value
:
String
formData
:
FormData
)
:
FormData

Returns a new FormData object copying all values from the given one and adding the given string with the given key.

FormData.empty()
|> FormData.addString("key", "value")
empty
:
FormData

Returns an empty FormData object.

FormData.empty()
|> FormData.addString("key", "value")
keys
(
formData
:
FormData
)
:
Array(String)

Returns the keys of a FormData object.

FormData.empty()
|> FormData.addString("key", "value")
|> FormData.keys() == ["key"]