You can use the transformqueryparams
policy to override incoming HTTP request query parameters.
You can override the HTTP query parameters by:
-
Clearing all existing query parameters
-
Adding to or updating the list of query parameters
-
Removing query parameters individually
You can also append a value to an existing query parameter.
The query parameter values of the incoming request are accessible via the {#request.params['query_parameter_name']}
construct.
"transform-queryparams": {
"addQueryParameters": [
{
"name": "myParam",
"value": "{#request.id}"
}
]
}
"transform-queryparams": {
"removeQueryParameters": [
"foo"
],
"addQueryParameters": [
{
"name": "myParam",
"value": "myValue"
}
]
}
"transform-queryparams": {
"clearAll": true,
"addQueryParameters": [
{
"name": "myParam",
"value": "myValue"
}
]
}
"transform-queryparams": {
"addQueryParameters": [
{
"name": "myParam",
"value": "myNewValue"
}
]
}
"transform-queryparams": {
"addQueryParameters": [
{
"name": "foo",
"value": "bar2",
"appendToExistingArray": true
},
{
"name": "foo",
"value": "bar3",
"appendToExistingArray": true
}
]
}
"transform-queryparams": {
"addQueryParameters": [
{
"name": "foo",
"value": "bar2",
"appendToExistingArray": false
},
{
"name": "foo",
"value": "bar3",
"appendToExistingArray": true
}
]
}