Chartbreaker
    Preparing search index...

    Interface FormData

    The FormData interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the fetch(), XMLHttpRequest.send() or navigator.sendBeacon() methods. It uses the same format a form would use if the encoding type were set to "multipart/form-data".

    MDN Reference

    interface FormData {
        "[iterator]"(): FormDataIterator<[string, FormDataEntryValue]>;
        append(name: string, value: string | Blob): void;
        append(name: string, value: string): void;
        append(name: string, blobValue: Blob, filename?: string): void;
        delete(name: string): void;
        entries(): FormDataIterator<[string, FormDataEntryValue]>;
        forEach(
            callbackfn: (
                value: FormDataEntryValue,
                key: string,
                parent: FormData,
            ) => void,
            thisArg?: any,
        ): void;
        get(name: string): FormDataEntryValue | null;
        getAll(name: string): FormDataEntryValue[];
        has(name: string): boolean;
        keys(): FormDataIterator<string>;
        set(name: string, value: string | Blob): void;
        set(name: string, value: string): void;
        set(name: string, blobValue: Blob, filename?: string): void;
        values(): FormDataIterator<FormDataEntryValue>;
    }
    Index

    Methods

    • The append() method of the FormData interface appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.

      MDN Reference

      Parameters

      • name: string
      • value: string | Blob

      Returns void

    • Parameters

      • name: string
      • value: string

      Returns void

    • Parameters

      • name: string
      • blobValue: Blob
      • Optionalfilename: string

      Returns void

    • The delete() method of the FormData interface deletes a key and its value(s) from a FormData object.

      MDN Reference

      Parameters

      • name: string

      Returns void

    • Parameters

      Returns void

    • The get() method of the FormData interface 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.

      MDN Reference

      Parameters

      • name: string

      Returns FormDataEntryValue | null

    • The has() method of the FormData interface returns whether a FormData object contains a certain key.

      MDN Reference

      Parameters

      • name: string

      Returns boolean

    • The set() method of the FormData interface sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.

      MDN Reference

      Parameters

      • name: string
      • value: string | Blob

      Returns void

    • Parameters

      • name: string
      • value: string

      Returns void

    • Parameters

      • name: string
      • blobValue: Blob
      • Optionalfilename: string

      Returns void