Package org.htmlunit.javascript.host.xml
Class FormData
java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.xml.FormData
- All Implemented Interfaces:
Serializable
,Cloneable
,org.htmlunit.corejs.javascript.ConstProperties
,org.htmlunit.corejs.javascript.debug.DebuggableObject
,org.htmlunit.corejs.javascript.Scriptable
,org.htmlunit.corejs.javascript.SymbolScriptable
A JavaScript object for
FormData
.- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Constant used to register the prototype in the context.private final List
<NameValuePair> Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Appends a new value onto an existing key inside aFormData
object, or adds the key if it does not already exist.void
Removes the entry (if exists).org.htmlunit.corejs.javascript.Scriptable
entries()
void
fillRequest
(WebRequest webRequest) Sets the specified request with the parameters in thisFormData
.void
The FormData.forEach() method allows iteration through all key/value pairs contained in this object via a callback function.org.htmlunit.corejs.javascript.Scriptable
boolean
void
jsConstructor
(Object formObj) Constructor.keys()
The FormData.keys() method returns an iterator allowing to go through all keys contained in this object.void
Sets a new value for an existing key inside aFormData
object, or adds the key if it does not already exist.values()
The URLSearchParams.values() method returns an iterator allowing to go through all values contained in this object.Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
-
Field Details
-
FORM_DATA_TAG
Constant used to register the prototype in the context.- See Also:
-
requestParameters_
-
-
Constructor Details
-
FormData
public FormData()Default constructor.
-
-
Method Details
-
jsConstructor
Constructor.- Parameters:
formObj
- a form
-
append
Appends a new value onto an existing key inside aFormData
object, or adds the key if it does not already exist.- Parameters:
name
- the name of the field whose data is contained invalue
value
- the field's valuefilename
- the filename reported to the server (optional)
-
delete_js
Removes the entry (if exists).- Parameters:
name
- the name of the field to remove
-
get
- Parameters:
name
- the name of the field to check- Returns:
- the first value found for the give name
-
getAll
- Parameters:
name
- the name of the field to check- Returns:
- the values found for the give name
-
has
- Parameters:
name
- the name of the field to check- Returns:
- true if the name exists
-
set
Sets a new value for an existing key inside aFormData
object, or adds the key if it does not already exist.- Parameters:
name
- the name of the field whose data is contained invalue
value
- the field's valuefilename
- the filename reported to the server (optional)
-
entries
public org.htmlunit.corejs.javascript.Scriptable entries()- Returns:
- An Iterator that contains all the requestParameters name[0] and value[1]
-
fillRequest
Sets the specified request with the parameters in thisFormData
.- Parameters:
webRequest
- the web request to fill
-
forEach
The FormData.forEach() method allows iteration through all key/value pairs contained in this object via a callback function.- Parameters:
callback
- Function to execute on each key/value pairs
-
keys
The FormData.keys() method returns an iterator allowing to go through all keys contained in this object. The keys are USVString objects.- Returns:
- an iterator.
-
values
The URLSearchParams.values() method returns an iterator allowing to go through all values contained in this object. The values are USVString objects.- Returns:
- an iterator.
-