gossamer/form_data
Types
A set of key/value pairs representing form fields and their values, useful for building request bodies for multipart form submissions. Mutable — methods modify the set in place and return it for chaining.
See FormData on MDN.
pub type FormData
Values
pub fn append(
to form_data: FormData,
name name: String,
value value: String,
) -> FormData
Appends a new value onto an existing key, or adds the key if it does not already exist. Mutates the form data in-place and returns it for chaining.
pub fn append_blob(
to form_data: FormData,
name name: String,
value value: blob.Blob,
) -> FormData
Appends a blob value. Mutates the form data in-place and returns it for chaining.
pub fn append_blob_with_filename(
to form_data: FormData,
name name: String,
value value: blob.Blob,
named filename: String,
) -> FormData
Appends a blob value with a filename. Mutates the form data in-place and returns it for chaining.
pub fn delete(
from form_data: FormData,
name name: String,
) -> FormData
Deletes a key and all its values. Mutates the form data in-place and returns it for chaining.
pub fn entries(
of form_data: FormData,
) -> iterator.Iterator(#(String, FormDataValue), Nil, Nil)
pub fn for_each(
in form_data: FormData,
run callback: fn(String, FormDataValue) -> a,
) -> Nil
pub fn get(
from form_data: FormData,
name name: String,
) -> Result(String, Nil)
Returns the first string value for name, or Error(Nil) if no such
key exists or its first value is a file.
pub fn get_file(
from form_data: FormData,
name name: String,
) -> Result(file.File, Nil)
Returns the first file value for name, or Error(Nil) if no such key
exists or its first value is a string.
pub fn keys(
of form_data: FormData,
) -> iterator.Iterator(String, Nil, Nil)
pub fn set(
in form_data: FormData,
name name: String,
value value: String,
) -> FormData
Sets a new value for an existing key, or adds the key if it does not already exist. Mutates the form data in-place and returns it for chaining.
pub fn set_blob(
in form_data: FormData,
name name: String,
value value: blob.Blob,
) -> FormData
Sets a blob value. Mutates the form data in-place and returns it for chaining.
pub fn set_blob_with_filename(
in form_data: FormData,
name name: String,
value value: blob.Blob,
named filename: String,
) -> FormData
Sets a blob value with a filename. Mutates the form data in-place and returns it for chaining.
pub fn values(
of form_data: FormData,
) -> iterator.Iterator(FormDataValue, Nil, Nil)