34 lines
1.0 KiB
Markdown
34 lines
1.0 KiB
Markdown
## getQueryParamList()
|
|
|
|
The `getQueryParamList()` command extracts the query parameters from the current HTTP request and stores a list of these parameters in a target variable. This is useful for handling and processing query parameters in web applications.
|
|
|
|
### Parameters
|
|
|
|
* TargetVariable Type: var Description: The variable in which the extracted query parameter list will be stored. This should be a variable where the command's result will be saved.
|
|
|
|
### Command Flow
|
|
|
|
### Usage Example
|
|
|
|
Suppose the HTTP query has the following parameters: `?user=alice&age=30`.
|
|
|
|
```javascript
|
|
// Define the variable to store the result
|
|
queryParamsList = []
|
|
|
|
// Call the command to extract query parameters
|
|
getQueryParamList(queryParamsList)
|
|
|
|
// Return the list of query parameters via addResult
|
|
addResult(queryParamsList)
|
|
```
|
|
|
|
Given the query string `?user=alice&age=30`, the `getQueryParamList()` command will generate the following list of parameters:
|
|
|
|
```javascript
|
|
[
|
|
{"user": "alice"},
|
|
{"age": "30"}
|
|
]
|
|
```
|