Js.FormDataBindings to FormData
The values returned by the `get,All` and iteration functions is either a string or a Blob. Melange uses an abstract type and defers to users of the API to handle it according to their application needs.
val make : unit -> tmake () creates a new FormData object, initially empty.
val append :
name:string ->
value:[ `String of string | `Object of < .. > Js.t | `Dict of _ Js.dict ] ->
t ->
unitappend t ~name ~value appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
val appendBlob :
name:string ->
value:[ `Blob of Js.blob | `File of Js.file ] ->
?filename:string ->
t ->
unitappendBlob t ~name ~value appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist. This method differs from append in that instances in the Blob hierarchy can pass a third filename argument.
val delete : name:string -> t -> unitdelete t ~name deletes a key and its value(s) from a FormData object.
val get : name:string -> t -> entryValue optionget t ~name returns the first value associated with a given key from within a FormData object. If you expect multiple values and want all of them, use getAll instead.
val getAll : name:string -> t -> entryValue arraygetAll t ~name returns all the values associated with a given key from within a FormData object.
val set :
name:string ->
[ `String of string | `Object of < .. > Js.t | `Dict of _ Js.dict ] ->
t ->
unitset t ~name ~value sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
val setBlob :
name:string ->
[ `Blob of Js.blob | `File of Js.file ] ->
?filename:string ->
t ->
unitsetBlob t ~name ~value ?filename sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist. This method differs from set in that instances in the Blob hierarchy can pass a third filename argument.
val has : name:string -> t -> boolhas ~name t returns whether a FormData object contains a certain key.
val keys : t -> string Js.iteratorkeys t returns an iterator which iterates through all keys contained in the FormData. The keys are strings.
val values : t -> entryValue Js.iteratorvalues t returns an iterator which iterates through all values contained in the FormData. The values are strings or Blob objects.
val entries : t -> (string * entryValue) Js.iteratorentries t returns an iterator which iterates through all key/value pairs contained in the FormData.