FormData
[<Interface>]
type FormData =
abstract member SymbolToStringTag: string
abstract member entries: unit -> obj with get, set
abstract member forEach: ForEach with get, set
abstract member keys: unit -> obj with get, set
abstract member values: unit -> obj with get, set
abstract member append (name: string, value: obj, ?fileName: string) : unit
abstract member delete (name: string) : unit
abstract member get (name: string) : obj option
abstract member getAll (name: string) : obj array
abstract member has (name: string) : bool
abstract member set (name: string, value: obj, ?fileName: string) : unit| Assembly | Xantham.Fable.Node |
| Implements | (string * obj) seq |
Declared inside
ForEach |
Properties
abstract member entries: unit -> obj with get, set
abstract member entries: unit -> obj with get, setReturns an iterator allowing to go through the FormData key/value pairs. The key of each pair is a string; the value is a FormDataValue.
abstract member forEach: ForEach with get, set
abstract member forEach: ForEach with get, setExecutes given callback function for each field of the FormData instance
abstract member keys: unit -> obj with get, set
abstract member keys: unit -> obj with get, setReturns an iterator allowing to go through all keys contained in this FormData object. Each key is a string.
abstract member values: unit -> obj with get, set
abstract member values: unit -> obj with get, setReturns an iterator allowing to go through all values contained in this object FormData object. Each value is a FormDataValue.
Methods
abstract member append (name: string, value: obj, ?fileName: string) : unit
abstract member append (name: string, value: obj, ?fileName: string) : unitAppends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.
The difference between set() and append() is that if the specified key already exists, set() will overwrite all existing values with the new one, whereas append() will append the new value onto the end of the existing set of values.
| Parameter | |
|---|---|
name | The name of the field whose data is contained in value. |
value | The field's value. This can be Blob or File. If none of these are specified the value is converted to a string. |
fileName | The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename. |
abstract member delete (name: string) : unit
abstract member delete (name: string) : unitDeletes a key and its value(s) from a FormData object.
| Parameter | |
|---|---|
name | The name of the key you want to delete. |
abstract member get (name: string) : obj option
abstract member get (name: string) : obj optionReturns the first value associated with a given key from within a FormData object. If you expect multiple values and want all of them, use the getAll() method instead.
| Parameter | |
|---|---|
name | A name of the value you want to retrieve. |
Returns. A FormDataEntryValue containing the value. If the key doesn't exist, the method returns null.
abstract member getAll (name: string) : obj array
abstract member getAll (name: string) : obj arrayReturns all the values associated with a given key from within a FormData object.
| Parameter | |
|---|---|
name | A name of the value you want to retrieve. |
Returns. An array of FormDataEntryValue whose key matches the value passed in the name parameter. If the key doesn't exist, the method returns an empty list.
abstract member has (name: string) : bool
abstract member has (name: string) : boolReturns a boolean stating whether a FormData object contains a certain key.
| Parameter | |
|---|---|
name | A string representing the name of the key you want to test for. |
Returns. A boolean value.
abstract member set (name: string, value: obj, ?fileName: string) : unit
abstract member set (name: string, value: obj, ?fileName: string) : unitSet a new value for an existing key inside FormData, or add the new field if it does not already exist.
| Parameter | |
|---|---|
name | The name of the field whose data is contained in value. |
value | The field's value. This can be Blob or File. If none of these are specified the value is converted to a string. |
fileName | The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename. |