= Transform Query Parameters Policy

ifdef::env-github[]
image:https://ci.gravitee.io/buildStatus/icon?job=gravitee-io/gravitee-policy-transformqueryparams/master["Build status", link="https://ci.gravitee.io/job/gravitee-io/job/gravitee-policy-transformqueryparams/"]
image:https://badges.gitter.im/Join Chat.svg["Gitter", link="https://gitter.im/gravitee-io/gravitee-io?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"]
endif::[]

== Phase

[cols="2*", options="header"]
|===
^|onRequest
^|onResponse

^.^| X
^.^|

|===

== Description

The Transform Query Parameters policy is used to override incoming request HTTP query parameters.
You can override these HTTP query parameters by:

* Clearing all existing query parameters
* Adding or updating list of query parameters
* Removing them individually

[source, json]
.Sample
----
"transform-queryparams": {
    "addQueryParameters": [
        {
            "name": "myParam",
            "value": "{#request.id}"
        }
    ],
    "removeQueryParameters": [
        "secretParam"
    ]
}
----
= Transform Query Parameters Policy

ifdef::env-github[]
image:https://ci.gravitee.io/buildStatus/icon?job=gravitee-io/gravitee-policy-transformqueryparams/master["Build status", link="https://ci.gravitee.io/job/gravitee-io/job/gravitee-policy-transformqueryparams/"]
image:https://badges.gitter.im/Join Chat.svg["Gitter", link="https://gitter.im/gravitee-io/gravitee-io?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"]
endif::[]

== Phase

[cols="2*", options="header"]
|===
^|onRequest
^|onResponse

^.^| X
^.^|

|===

== Description

The Transform Query Parameters policy is used to override incoming request HTTP query parameters.
You can override these HTTP query parameters by:

* Clearing all existing query parameters
* Adding or updating list of query parameters
* Removing them individually

The values of query parameters of the incoming request are accessible via the `{#request.params['query_parameter_name']}` construct. 

The example below shows how to add the ID of the incoming request to the outgoing request.

[source, json]
.Sample
----
"transform-queryparams": {
    "addQueryParameters": [
        {
            "name": "myParam",
            "value": "{#request.id}"
        }
    ],
    "removeQueryParameters": [
        "secretParam"
    ]
}
----

Document how to access incoming query parameters
Document how to access incoming query parameters

It wasn't clear how to use values of query parameters of the incoming request.