Private
#privateAppends 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.
The name of the field whose data is contained in value
.
Optional
fileName: stringThe 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.
Returns an iterator
allowing to go through the FormData
key/value pairs.
The key of each pair is a string; the value is a FormDataValue
.
Executes given callback function for each field of the FormData instance
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 the getAll()
method instead.
A FormDataEntryValue
containing the value. If the key doesn't exist, the method returns null.
A name of the value you want to retrieve.
Returns all the values associated with a given key from within a FormData
object.
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.
A name of the value you want to retrieve.
Returns an iterator
allowing to go through all keys contained in this FormData
object.
Each key is a string
.
Set a new value for an existing key inside FormData, or add the new field if it does not already exist.
The name of the field whose data is contained in value
.
Optional
fileName: stringThe 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.
Returns an iterator
allowing to go through all values contained in this object FormData
object.
Each value is a FormDataValue
.
Static
[hasGenerated using TypeDoc
Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using fetch().
Note that this object is not a part of Node.js, so you might need to check if an HTTP client of your choice support spec-compliant FormData. However, if your HTTP client does not support FormData, you can use
form-data-encoder
package to handle "multipart/form-data" encoding.