Constructor
- Description:
- Creates a new FormUrlEncoded instance
- Source:
Example
const form = new FormUrlEncoded({ foo: 'bar', baz: 'qux' });
Parameters:
Name |
Type |
Attributes |
Description |
params |
Object.<string, string>
|
<optional>
|
Optional initial parameters as key-value pairs |
Methods
set(param, value) → {void}
- Description:
- Sets or replaces a parameter value
- Source:
Parameters:
Name |
Type |
Description |
param |
string
|
The parameter name |
value |
string
|
The parameter value |
Returns:
-
Type
-
void
append(param, value) → {void}
- Description:
- Appends a new value to an existing parameter
- Source:
Parameters:
Name |
Type |
Description |
param |
string
|
The parameter name |
value |
string
|
The parameter value |
Returns:
-
Type
-
void
delete(param) → {void}
- Description:
- Source:
Parameters:
Name |
Type |
Description |
param |
string
|
The parameter name to remove |
Returns:
-
Type
-
void
str() → {string}
- Description:
- Returns the encoded string representation (space encoded as %20)
Suitable for application/x-www-form-urlencoded content
- Source:
Example
form.str(); // returns "foo=bar&baz=qux"
Returns:
The encoded form data
-
Type
-
string
url() → {URLSearchParams}
- Description:
- Returns the underlying URLSearchParams object
- Source:
Returns:
The native URLSearchParams instance
-
Type
-
URLSearchParams