FormData class

The interface 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 the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". You can also pass it directly to the URLSearchParams constructor if you want to generate query parameters in the way a <form> would do if it were using simple GET submission. An object implementing can directly be used in a for...of structure, instead of entries(): for (var p of myFormData) is equivalent to for (var p of myFormData.entries()).

Note: This feature is available in Web Workers.

Inheritance
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

FormData([HTMLFormElement? form])
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

append(String name, [Blob? blobValue, String? filename]) → void

Available on FormData, provided by the PropsFormData extension

delete(String name) → void

Available on FormData, provided by the PropsFormData extension

get(String name) → dynamic

Available on FormData, provided by the PropsFormData extension

getAll(String name) Iterable

Available on FormData, provided by the PropsFormData extension

has(String name) bool

Available on FormData, provided by the PropsFormData extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(String name, [Blob? blobValue, String? filename]) → void

Available on FormData, provided by the PropsFormData extension

toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited